nyoj_34_韩信点兵

 中国剩余定理:

代码:

#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
    int a,b,c;
    while(scanf("%d %d %d",&a,&b,&c)!=EOF){
        int s=70*a+21*b+15*c;
        s%=105;
        if(s<=100 && s>=10){
            printf("%d\n",s);
        }else{
            printf("No anwser\n");
        }
    }

    return 0;
}

 

posted @ 2016-09-11 17:40  多一份不为什么的坚持  阅读(133)  评论(0编辑  收藏  举报