标签:inpu color else chmod cep div include 判断 main
1 #include <iostream> 2 #include <string> 3 using namespace std; 4 int main() 5 { 6 int end, count1, count2, count3, flag; 7 string a; 8 while (cin >> a) 9 { 10 flag = 1; 11 count1 = count2 = count3 = 0; 12 end = 0; 13 for (int i = 0; i < a.length(); i++) 14 { 15 if (flag == 1) 16 { 17 if (a.at(i) == ‘o‘) 18 { 19 count1++; 20 continue; 21 } 22 else if (a.at(i) == ‘z‘) 23 { 24 flag = 2; 25 continue; 26 } 27 else if (a.at(i) == ‘j‘) 28 { 29 end = 1; 30 break; 31 } 32 } 33 if (flag == 2) 34 { 35 if (a.at(i) == ‘o‘) 36 { 37 count2++; 38 continue; 39 } 40 else if (a.at(i) == ‘j‘) 41 { 42 flag = 3; 43 continue; 44 } 45 else if (a.at(i) == ‘z‘) 46 { 47 end = 1; 48 break; 49 } 50 } 51 if (flag == 3) 52 { 53 if (a.at(i) == ‘o‘) 54 { 55 count3++; 56 continue; 57 } 58 else 59 { 60 end = 1; 61 break; 62 } 63 } 64 } 65 if (end) 66 { 67 printf("Wrong Answer\n"); 68 } 69 else 70 { 71 if (flag ==3&&count1*count2 == count3&&count2) 72 printf("Accepted\n"); 73 else 74 printf("Wrong Answer\n"); 75 } 76 } 77 return 0; 78 }
标签:inpu color else chmod cep div include 判断 main
原文地址:https://www.cnblogs.com/1625--H/p/9348126.html