HDU - 2101 #A + B Problem Too

This problem is also a A + B problem,but it has a little difference,you should determine does (a+b) could be divided with 86.For example ,if (A+B)=98,you should output no for result.
Input
Each line will contain two integers A and B. Process to end of file.
Output
For each case, if(A+B)%86=0,output yes in one line,else output no in one line.
Sample Input
1 1
8600 8600
Sample Output
no
yes

问题链接(https://vjudge.net/problem/HDU-2101)

问题简述:输入A,B值,对A+B的结果进行判断。如果(A+B)%86=0,则输出yes,否则就输出no。

问题分析:这是简单的一道对If语句的一个考查。本程序运用if语句对输入的A B值直接进行判断

AC通过的C++语言如下

#include<iostream>
using namespace std;
int main()
{
    int A, B;
    while (cin >> A >> B)
    {
        if ((A + B) % 86 == 0)
        {
            cout << "yes" << endl;
        }
        else cout << "no" << endl;
    }
    return 0;
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,186评论 0 10
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,522评论 0 23
  • 很多时候我们要学会原谅自己,原谅他人!原谅就是释怀,让自己与不快乐的人和事说再见,不纠结,不郁闷! ...
    我就是00后阅读 1,315评论 0 0
  • 今天六一儿童节,是孩子们的节日,也是我的农历生日,尽管我提醒过他,老公自始至终也没一句“生日快乐”,倒是我所教班级...
    心有灵犀J阅读 1,679评论 0 5
  • 亲爱的女儿,今天放学回来,一下车子,车门都顾不得关上。一蹦一跳的朝我走来说:“妈妈你看这是什么。”手上拿着一包面包...
    错误是宝贝阅读 2,166评论 0 1

友情链接更多精彩内容