1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
#include <fstream>
#include <cstring>
int main()
{
char fName[4] ={};
char lName[25] = {};
char rank[25] = {};
char club[10] = {};
int sabreA= 0;
int sabreB= 0;
int sabreC= 0;
int sabreD= 0;
int sabreE= 0;
int sabreU= 0;
int foilA= 0;
int foilB= 0;
int foilC= 0;
int foilD= 0;
int foilE= 0;
int foilU= 0;
int epeeA= 0;
int epeeB= 0;
int epeeC= 0;
int epeeD= 0;
int epeeE= 0;
int epeeU= 0;
std::cout << "First Name? <type 'END' to quit> " << std::flush;
std::cin >> fName;
while(strcmp(fName, "END"))
{
std::cout << "Last Name? " << std::flush;
std::cin >> lName;
std::cout << "Ranking? " << std::flush;
std::cin >> rank;
std::cout << "Fencing Club? " << std::flush;
std::cin >> club;
if(strcmp(rank, "A")&&(club, "sabre"))
sabreA++;
if(strcmp(rank, "B")&&(club, "sabre"))
sabreB++;
if(strcmp(rank, "C")&&(club, "sabre"))
sabreC++;
if(strcmp(rank, "D")&&(club, "sabre"))
sabreD++;
if(strcmp(rank, "E")&&(club, "sabre"))
sabreE++;
if(strcmp(rank, "U")&&(club, "sabre"))
sabreU++;
if(strcmp(rank, "A")&&(club, "foil"))
foilA++;
if(strcmp(rank, "B")&&(club, "foil"))
foilB++;
if(strcmp(rank, "C")&&(club, "foil"))
foilC++;
if(strcmp(rank, "D")&&(club, "foil"))
foilD++;
if(strcmp(rank, "E")&&(club, "foil"))
foilE++;
if(strcmp(rank, "U")&&(club, "foil"))
foilU++;
if(strcmp(rank, "A")&&(club, "epee"))
epeeA++;
if(strcmp(rank, "B")&&(club, "epee"))
epeeB++;
if(strcmp(rank, "C")&&(club, "epee"))
epeeC++;
if(strcmp(rank, "D")&&(club, "epee"))
epeeD++;
if(strcmp(rank, "E")&&(club, "epee"))
epeeE++;
if(strcmp(rank, "U")&&(club, "epee"))
epeeU++;
std::cout << "First Name? <type 'END' to quit> " << std::flush;
std::cin >> fName;
}
std::cout << "There are " << sabreA << "people competing in rank A with the sabre." <<std::endl;
std::cout << "There are " << sabreB << "people competing in rank B with the sabre." <<std::endl;
std::cout << "There are " << sabreC << "people competing in rank C with the sabre." <<std::endl;
std::cout << "There are " << sabreD << "people competing in rank D with the sabre." <<std::endl;
std::cout << "There are " << sabreE << "people competing in rank E with the sabre." <<std::endl;
std::cout << "There are " << sabreU << "people competing in rank U with the sabre." <<std::endl;
std::cout << "There are " << foilA << "people competing in rank A with the foil." <<std::endl;
std::cout << "There are " << foilB << "people competing in rank B with the foil." <<std::endl;
std::cout << "There are " << foilC << "people competing in rank C with the foil." <<std::endl;
std::cout << "There are " << foilD << "people competing in rank D with the foil." <<std::endl;
std::cout << "There are " << foilE << "people competing in rank E with the foil." <<std::endl;
std::cout << "There are " << foilU << "people competing in rank U with the foil." <<std::endl;
std::cout << "There are " << epeeA << "people competing in rank A with the epee." <<std::endl;
std::cout << "There are " << epeeB << "people competing in rank B with the epee." <<std::endl;
std::cout << "There are " << epeeC << "people competing in rank C with the epee." <<std::endl;
std::cout << "There are " << epeeD << "people competing in rank D with the epee." <<std::endl;
std::cout << "There are " << epeeE << "people competing in rank E with the epee." <<std::endl;
std::cout << "There are " << epeeU << "people competing in rank U with the e[ee." <<std::endl;
return (0);
}
|