|
|
back to boardПочему не проходит!!!! Posted by Kvasela 30 Mar 2012 18:44 #include <iostream> #include <string.h> using namespace std; void main() { int exp = 0; char fast[10]; int optimal = 0; int no_optimal = 0; int gorih; cin >> exp; for(int i = 1; i <= exp; i++) { cin >> gorih; cin>>fast; if(!strcmp(fast,"satisfied")) { if(optimal > gorih) { optimal = gorih;}if(optimal == 0){optimal=gorih;}} else {if(no_optimal==0){no_optimal=gorih;}if(no_optimal<gorih){no_optimal=gorih;}} } if(optimal == 0){cout<<"Inconsistent";} else if(optimal>no_optimal){ cout<<optimal;} else {cout<<"Inconsistent";} } Re: Почему не проходит!!!! It is known as a fact, that ten walnuts is always enough and two walnuts are always not enough. |
|
|