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的結(jié)果進行判斷。如果(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;
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,854評論 0 10
  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 11,116評論 0 23
  • 很多時候我們要學(xué)會原諒自己,原諒他人!原諒就是釋懷,讓自己與不快樂的人和事說再見,不糾結(jié),不郁悶! ...
    我就是00后閱讀 172評論 0 0
  • 今天六一兒童節(jié),是孩子們的節(jié)日,也是我的農(nóng)歷生日,盡管我提醒過他,老公自始至終也沒一句“生日快樂”,倒是我所教班級...
    心有靈犀J閱讀 269評論 0 5
  • 親愛的女兒,今天放學(xué)回來,一下車子,車門都顧不得關(guān)上。一蹦一跳的朝我走來說:“媽媽你看這是什么?!笔稚夏弥话姘?..
    錯誤是寶貝閱讀 311評論 0 1

友情鏈接更多精彩內(nèi)容