TOPIC

100% Wrong Answer?

Eduardo Cassiano asked 3 years ago

Olá pessoal, qual o problema deste código? Fiz vários testes e tudo parece estar bem. Agradeço desde já.

#include<iostream>
#include<string>

using namespace std;

int main(){

    string patosString;
    unsigned long int patos = 0;

    getline(cin, patosString);

    while(patosString.compare("-1") != 0){

        patos = stoull (patosString, 0,0);

        if(patos)
           cout << patos-1 << endl;
        else
           cout << patos << endl;

        getline(cin, patosString);
    }

}//fim[main]

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.