uva 10499 - The Land of Justice

感觉很简单的一题,但是wa了两次,还是看了网上的代码才知道,虽然N是int型的,但是25*n就不一定是了,改成long就行了

#include<iostream>
using namespace std;
int main(){
    long n;
    while(cin>>n){
        if(n<0)
            break;
        if(n==1){
            cout<<"0%"<<endl;
            continue;
        }
        cout<<n*25<<"%"<<endl;
    }
}

 

posted on 2014-01-10 20:18  云在心  阅读(135)  评论(0)    收藏  举报

导航