TOPIC
Wrong aswer
dmtx01 asked 4 years ago
Alguém me da uma luz, a saída ao meu ver esta correta mas esta dando wrong answer 35%.
include
using namespace std;
int main(){
int s=0;
string c;
while(getline(cin, c)){
if(c[0] == '*' || c[0] == '-'){
for(int i = 0; i < 3; i++){
if(i == 0 && c[i] == '*'){
s += 4;
}
else if(i == 1 && c[i] == '*'){
s += 2;
}
else if(i == 2 && c[i] == '*'){
s += 1;
}
}
}
else{
cout << s << endl;
s = 0;
}
}
}
This topic was solved and cannot recieve new replies.