#include <stdio.h>
#include <iostream>
using namespace std;
int main(void) {
int cont, maior = 0;
do {
cout << "digite um valor: ";
cin >> cont;
//Se o valor entrado for maior que o ultimo passa ele a ser o maior
if(cont > maior)maior = cont;
}while (cont != -1);
cout << "o maior numero e: " << maior;
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxpb3N0cmVhbT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKHZvaWQpIHsKICAgIGludCBjb250LCBtYWlvciA9IDA7CiAgICBkbyB7CiAgICAgICAgY291dCA8PCAiZGlnaXRlIHVtIHZhbG9yOiAiOwogICAgICAgIGNpbiA+PiBjb250OwogICAgICAgIC8vU2UgbyB2YWxvciBlbnRyYWRvIGZvciBtYWlvciBxdWUgbyB1bHRpbW8gcGFzc2EgZWxlIGEgc2VyIG8gbWFpb3IKICAgICAgICBpZihjb250ID4gbWFpb3IpbWFpb3IgPSBjb250OwogICAgfXdoaWxlIChjb250ICE9IC0xKTsKICAgIGNvdXQgPDwgIm8gbWFpb3IgbnVtZXJvIGU6ICIgPDwgbWFpb3I7CiAgICByZXR1cm4gMDsKfQo=