neuq.oj 1003
題目描述:
輸入兩個數A,B,輸出A+B的值。輸入:
多組資料:每組由兩個整數(a和b)構成,a和b之間用空格隔開,每組輸入單獨佔一行。當輸入為 0 0 時,輸入結束。0 0這組資料不處理。
輸出:
對於每一組測試用例,輸出齊對應的和,每組資料一行。
樣例輸入:
1 2
3 4
10 20
0 0
樣例輸出:
3
7
30
c++程式碼:
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
while (cin>>a>>b)
{
if(a==0&&b==0)break;
else
{
c=a+b;
cout<<c<<endl;
}
}
return 0;
}
相關推薦
neuq.oj 1003
題目描述: 輸入兩個數A,B,輸出A+B的值。 輸入: 多組資料:每組由兩個整數(a和b)構成,a和b之間用空格隔開,每組輸入單獨佔一行。 當輸入為 0 0 時,輸入結束。0 0這組資料不處理。 輸出: 對於每一組測試用例,輸出齊對應的和,每組資料一行。
廈理OJ——1003:第三屆程式設計大賽 讓氣球飛起來
一、題目 Description 比賽又一次開始了,看著氣球漂浮在周邊是多麼興奮的事情啊,但是告訴你一個祕密,裁判最喜歡做的事情就是猜一個問題,即數目最多的氣球顏色。當比賽結束時,他們會數每種顏色的氣球數目並公佈結果。今年,他們決定將數氣球的事情交給你做。 Input 測試資料第
CDUTCM OJ 1003: 半情歌的密碼
題目描述 “半情歌密碼” 1把中文字寫成拼音:”banqingge”。 2將所有字元的ACSII碼相加得到一個sum = 940. 3由於密碼太短,所以將sum轉換成二進位制1110101100,這個就是我的密碼啦! 輸入 首先是一個N表示有N個字串,接著是N行,
neuq.oj 1019
1019: 求和again 題目描述: 最近谷學長遇到了麻煩的問題,你能幫幫他嗎? 題目是這樣的:計算SUM(n) = 1 + 2 + 3 + … + 10^n。滿足n<=100 000。 輸入: 輸入包含多組資料,每組資料一行,包括一個整數n(n<=10
neuq.oj 1017
1017: 平面切割(特別版) 題目描述: 我們要求的是n條閃電型折線分割平面的最大數目。比如,一條閃電型折線可以將平面分成兩部分,兩條最多可以將平面分成12部分,三條最多可將平面分成31部分,四條最多則可將一個平面分為59部分。 輸入: 輸入資料的第一行是一個整數C,表示
neuq.oj 1016
1016: Roliygu and Yilan 題目描述: Roliygu is famous because he likes to play games. Today he puts a chessboard in the desktop,and plays a game
neuq.oj 1144
1144: 【C語言訓練】大、小寫問題 題目描述: 輸入一串字元,將其中的大寫變成小寫,若不為大寫則原樣輸出 輸入: 任意字串(長度在100以內)以回車表示輸入結束 輸出: 將其中的大寫 輸出相應的小寫,若不為大寫則原樣輸出 樣例輸入:
neuq.oj 1005
1005: A+B(基本輸入輸出5) 題目描述: 多個數求和。 輸入: 第一行為N,下面緊跟N行資料。每行資料:開頭為M,後面緊跟M個數。 輸出: 輸出每一行M個整數的和,每個資料一行。 樣例輸入 2 1 1 2 3 4 樣例輸出
neuq.oj 1004
1004: A+B(基本輸入輸出4) 題目描述: 多個數求和。 輸入: 第一行為N,下面緊跟N行資料。每行資料:開頭為M,後面緊跟M個數。 輸出: 輸出每一行M個整數的和,每個資料一行。 樣例輸入: 2 1 1 2 3 4 樣例輸
neuq.oj 1002
1002: A+B(基本輸入輸出2) 題目描述: 輸入兩個數A,B,輸出A+B的值。 輸入: 第一行是資料的組數N,從第二行開始是N組由兩個整數(a和b)構成的資料,a和b之間用空格隔開,每組輸入單獨佔一行 輸出: 每組的兩個整數(a和b)求和並輸出,每組
zzuli OJ 1003:兩個整數的四則運算
題目描述 輸入兩個整數num1和num2,請你設計一個程式,計算並輸出它們的和、差、積、整數商及餘數。 輸入 輸入只有兩個正整數num1、num2。 輸出 輸出佔一行,包括兩個數的和、差、積、商及餘數,資料之間用一個空格隔開。 樣例輸入 1 2 樣例輸出 3 -1 2 0 1
【NEUQ OJ】 1029: C基礎-求解方程
#include <iostream> using namespace std; int main() { int x,y; for(x=100;x<1000;x++) { y=(x%10)*100+(x/100)+(x-((x/100)*100)-(x%10)); if((
zzuli OJ 1003: 兩個整數的四則運算
Description 輸入兩個整數num1和num2,請你設計一個程式,計算並輸出它們的和、差、積、整數商及餘數。 Input 輸入只有兩個正整數num1、num2。 Output 輸
九度OJ 1003:A+B
時間限制:1 秒 記憶體限制:32 兆 特殊判題:否 提交:15078 解決:6299 題目描述: 給定兩個整數A和B,其表示形式是:從個位開始,每三位數用逗號","隔開。 現在請
九度OJ 題目1003:A+B
一.題目描述: 給定兩個整數A和B,其表示形式是:從個位開始,每三位數用逗號","隔開。 現在請計算A+B的結果,並以正常形式輸出。 輸入: 輸入包含多組資料資料,每組資料佔一行,由兩個整數A和B組成(-10^9 < A,B < 10^9)。 輸出: 請
幾個很好的OJ網站
acc 應該 ica class dev tco 友好 題目 如果 很友好的OJ網站(OJ是open judge,在線評測) POJ 北京大學ACM ZOJ 浙江大學ACM WOJ 武漢大學ACM(一個題目提交通過後,可以查看通過該題的所有代碼) 唯一不好的地方是
杭電女生賽1003
%d 個數 ns2 nbsp 告訴 一句話 pan return spa 題意:給一個序列,刪除一個數,令這個序列的gcd最大 思路:求出原始序列的gcd=g,然後從左邊跑一遍gcd,如果gcd==c 標記 r,那麽a[r] 肯定和前面某個數的gcd為 c , 再從r開始完
杭電女生賽1001 1002 1003 1005 1008 hdu6023 6024 6025 6027 6030
node ace std ret != power tac ns2 clas 代碼先貼這裏 #include "iostream" #include "string.h" #include "stack" #include "queue" #include "string
2017 ccpc女生專場 1003 Coprime Sequence
style rst des 一個數 output sequence amp efi comm 前綴後綴gcd,其實自己中用的是種奇怪的方法A掉的,不過先把這個學上,自己的方法有時間再填。 題意 告訴你N個數,求刪除一個數可以求得最大GCD。 N可能是100000。 思路 這
洛谷OJ 1373 小a和uim之大逃離 DP
方法 blog brush cnblogs 計算 memset end namespace cpp https://www.luogu.org/problem/show?pid=1373 題意:n*m地圖,n,m<=800,起點,終點任意,兩個人每次輪流取出點中的數並