Results 1 to 7 of 7
Hybrid View
-
29th January 2011 19:31 #1Registered User
Join Date: Jul:2010
Location: Plovdiv
Posts: 28
.
Person
1.
2. ( F)
3.
4.
.
1. 7 Person
2. .
- .
#include <iostream>
#include <string>
using namespace std;
struct rabotnik
{
string name;
char sex[1];
string dlujnost;
int zaplata;
}person [5];
int main() {
for (int i = 0; i < 5; i++)
{
cout << i + 1 << " Ime: ";
cin >> person[i].name;
cout << i + 1 << " Pol M ili ";
cin >> person[i].sex;
cout << i + 1 << " Dlujnost: ";
cin >> person[i].dlujnost;
cout << i + 1 << " Zaplata: ";
cin >> person[i].zaplata;
}
cout<<endl;
int sr;
char ch=1;
ch=person[i].sex;
for (int i = 0; i < 5; i++) {
if ( person[i].zaplata=='M')
sr=....
}
else if ( person[i].zaplata=='F'){
sr=..
}
system("PAUSE");
return 0;
}
-
29th January 2011 20:09 #2
, :
1. 7 Person
. , , .
4 .
Code:char ch=1; ch=person[i].sex; for (int i = 0; i < 5; i++) { if ( person[i].zaplata=='M')''? * *
- !
...
-
29th January 2011 20:25 #3Registered User
Join Date: Jul:2010
Location: Plovdiv
Posts: 28
5 .
#include <iostream>
#include <string>
using namespace std;
struct rabotnik
{
string name;
char sex[1];
string dlujnost;
int zaplata;
}person [7];
int main() {
for (int i = 0; i < 7; i++)
{
cout << i + 1 << " Ime: ";
cin >> person[i].name;
cout << i + 1 << " Pol M ili ";
cin >> person[i].sex;
cout << i + 1 << " Dlujnost: ";
cin >> person[i].dlujnost;
cout << i + 1 << " Zaplata: ";
cin >> person[i].zaplata;
}
cout<<endl;
int sr;
char ch=1;
ch=person[i].sex;
for (int i = 0; i < 7; i++) {
if ( person[i].zaplata=='M')
sr=....
}
else if ( person[i].zaplata=='F'){
sr=..
}
system("PAUSE");
return 0;
}
-
29th January 2011 20:38 #4
-
29th January 2011 20:44 #5Registered User
Join Date: Jul:2010
Location: Plovdiv
Posts: 28
. ch. . .
-
29th January 2011 21:26 #6
, .

- , .
---------- Post added at 21:26 ---------- Previous post was at 20:53 ----------
, .
ch=person[i].sex; for . - , , . , . , sborZaplatiMaje/broiMaje .''? * *
- !
...
-
29th January 2011 22:23 #7Registered User
Join Date: Jul:2010
Location: Plovdiv
Posts: 28




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in