hdu 1283 最简易的Computer

 

A + B Problem(1000)

Time
Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K
(Java/Others) Total Submission(s): 355051    Accepted Submission(s):
110841

Problem Description

Calculate A + B.

 

Input

Each line will contain two integers A and B. Process to end of file.

 

Output

For each case, output A + B in one line.

 

Sample Input

1 1

 

Sample Output

2

 

ps:

 

题意:每黄金年代行输入包罗八个整数a和b,每种案例输出a+b的值,在豆蔻梢头行;

详尽代码,

#include<stdio.h>
int main()
{
    int a,b,sum;
    while(scanf("%d%d",&a,&b)!=EOF)
    {
     sum=a+b;
        printf("%dn",sum);
    }
    return 0;
}

 

最轻巧易行的Computer

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K
(Java/Others)
Total Submission(s): 5707 Accepted Submission(s): 3184

Problem Description
多少个名称叫是PigHeadThree的探讨团体思索了生龙活虎台实验用的Computer,命名称为PpMm。PpMm只好实行轻易的八种命令A,B,C,D,E,F;唯有二个内部存款和储蓄器M1,M2;多个存放器Odyssey1,Evoque2,陆风X83。各样命令的意思如下:
命令A:将内部存款和储蓄器M1的数据装到存放器XC90第11中学;
命令B:将内部存款和储蓄器M2的数码装到贮存器库罗德第22中学;
命令C:将寄放器PAJERO3的多寡装到内部存储器M1中;
命令D:将寄放器本田CR-V3的数目装到内部存款和储蓄器M第22中学;
命令E:将寄放器Rubicon第11中学的数据和贮存器PAJERO第22中学的数据相加,结果放到存放器AMG ONE3中;
命令F:将存放器帕杰罗第11中学的数据和存放器奥迪Q3第22中学的数据相减,结果放到贮存器奥迪Q33中。
你的任务是:设计叁个主次模拟PpMm的周转。

Input
有几多组,每组有2行,第风度翩翩行是2个整数,分别代表M1和M第22中学的初叶内容;第二行是风流浪漫串长度不超越200的由大写字母A到F组成的命令串,命令串的含义如上所述。
Output
对应每生龙活虎组的输入,输出独有大器晚成行,三个整数,分别表示M1,M2的内容;此中M1和M2之间用逗号隔开分离。

别的验证:LAND1,酷路泽2,Rubicon3的起首值为0,全体中等结果都在-2^31和2^31里面。
Sample Input

100 288
ABECED
876356 321456
ABECAEDBECAF

Sample Output

388,388
2717080,1519268

Author SmallBeer(CML)
Source 杭电ACM集中训练队演习赛(VII卡塔尔国
Recommend lcy | We have carefully selected several similar problems for
you: 1114 1282 1266 1300 1253

Statistic | Submit | Discuss | Note

 

很简单的一个水题 能够做做找找信心。。

 

#include 
#include 
int main()
{
 int m1,m2,r1,r2,r3;
 char str[205];
 while(scanf(%d %d,&m1,&m2)!=EOF)
 {
  r1=r2=r3=0;
  scanf(%s,str);
  int len=strlen(str);
  for(int i=0;i  

1283 最简便易行的微处理机 最简单易行的微型机 Time
Limit: 二〇〇三/1000 MS (Java/Others) Memory Limit: 65536/32768 K
(Java/Others) Total Submission(s): 5707 Accepted Submission(…

Sum Problem(1001)

Time
Limit: 1000/500 MS (Java/Others)    Memory Limit: 65536/32768 K
(Java/Others) Total Submission(s): 237995    Accepted Submission(s):
58229

Problem Description

Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).
In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + … + n.

 

Input

The input will consist of a series of integers n, one integer per line.

 

Output

For each case, output SUM(n) in one
line, followed by a blank
line. You may assume the result will be in the range of 32-bit
signed integer.

 

Sample Input

1

100

 

Sample Output

1

 

5050

 

 ps:

 

 题意:每行将输入三个整数n,对于每一个案例,输出SUM(n)
= 1 + 2 + 3 +  … + n<求1到n的和>
在生龙活虎行,紧随其后的是一个空行。

 

别的的就没怎能够当心的了。

详见代码:

#include<stdio.h>
int main()
{
    int n,i,sum;

    while(scanf("%d",&n)!=EOF)
    {
            for(sum=0,i=0;i<=n;i++)
            sum=sum+i;
            printf("%dnn",sum);
    }
    return 0;
}

 

 

A+B for Input-Output Practice (I)(1089)

Time
Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K
(Java/Others) Total Submission(s): 68193    Accepted Submission(s):
37929

Problem Description

Your task is to Calculate a + b. Too easy?! Of course! I specially
designed the problem for acm beginners. You must have found that some
problems have the same titles with this one, yes, all these problems
were designed for the same aim.

 

Input

The input will consist of a series of pairs of integers a and b,
separated by a space, one pair of integers per line.

 

Output

For each pair of input integers a and b you should output the sum of a
and b in one line, and with one line of output for each line in input.

 

Sample Input

1 5

10 20

 

Sample Output

6

30

 

题意:输入整数a和b,用空格分隔,每行意气风发对整数。对于每少年老成对输入整数a和b你应当出口他们的总和,输入a和b占在风流洒脱行,输出占黄金时代行。

肖似和1000是相近的,o(∩_∩)o
哈哈!

#include<stdio.h>
int main()
{
    int a,b,sum;
    while(scanf("%d%d",&a,&b)!=EOF)
    {
     sum=a+b;
      printf("%dn",sum);
    }
    return 0;
}

 

A+B for Input-Output Practice (II)(1090)

Time
Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K
(Java/Others) Total Submission(s): 51355    Accepted Submission(s):
33780

Problem Description

Your task is to Calculate a + b.

 

Input

Input contains an integer N in the first line, and then N lines follow.
Each line consists of a pair of integers a and b, separated by a space,
one pair of integers per line.

 

Output

For each pair of input integers a and b you should output the sum of a
and b in one line, and with one line of output for each line in input.

 

Sample Input

2

1 5

10 20

 

Sample Output

6

30

 

ps:

 

题意:输入包罗多个整数N在率先行,然后有N数据。每风华正茂行蕴含风流倜傥对整数a和b,用空格分隔,每行意气风发对整数。

    
对于每生龙活虎对输入整数a和b你应有出口的总的数量,a和b在风姿浪漫行,输出输入各占意气风发行。

相比1089,在1089的底工上多了四个调控输入测量试验的组数N,其余的等同。有木有。

详细代码;

#include<stdio.h>
int main()
{
    int a,b,t,sum;
    scanf("%d",&t);   
    while(t--)
    {
        scanf("%d%d",&a,&b);
        sum=a+b;
        printf("%dn",sum);
    }
    return 0;
}

 

 

A+B for Input-Output Practice (III)(1091)

Time
Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K
(Java/Others) Total Submission(s): 60600    Accepted Submission(s):
31168

Problem Description

Your task is to Calculate a + b.

 

Input

Input contains multiple test cases. Each test case contains a pair of
integers a and b, one pair of integers per line. A test case containing 0 0 terminates the input
and this test case is not to be processed.

 

Output

For each pair of input integers a and b you should output the sum of a
and b in one line, and with one line of output for each line in input.

 

Sample Input

1 5

10 20

0 0

 

Sample Output

6

30

ps:

 

题意:输入包罗八个测量试验用例。每一种测量检验用例包罗大器晚成对整数a和b,黄金年代对整数占风流倜傥行。当输入测验用例为0
0时,终止输入和测验用例是不被拍卖。对于每生龙活虎对输入整数a和b你应有出口他们的总和,a和b在生龙活虎行,输出在大器晚成行。

 

正如1091,不风度翩翩致的地点就是终结输入的原则不等同,其余的不改变,有木有。

详细代码:

#include<stdio.h>
int main()
{
    int a,b,sum;
    while(scanf("%d%d",&a,&b)!=EOF)
    {
        if(a==0&&b==0)break;
        sum=a+b;
        printf("%dn",sum);

    }
    return 0;
}

 

 

 

A+B for Input-Output Practice (IV)

Time
Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K
(Java/Others) Total Submission(s): 53974    Accepted Submission(s):
28848

Problem Description

Your task is to Calculate the sum of some integers.

 

Input

Input contains multiple test cases. Each test case contains a integer N,
and then N integers follow in the same line. A test case starting with 0
terminates the input and this test case is not to be processed.

 

Output

For each group of input integers you should output their sum in one
line, and with one line of output for each line in input.

 

Sample Input

4 1 2 3 4

5 1 2 3 4 5

0

 

Sample Output

10

15

 

ps:

 

题意:输入包括八个测量试验用例。每一种测验用例满含贰个整数N,然后在同等行输入N个整数,。当测验用例是0时,终止输入和测验用例是不被拍卖。每组输出整数之和占黄金年代行,即,少年老成行输入黄金年代行输出。

 

相比前边几题,那题微微有一点分别但变幻一点都不大,N用来调控整数的个数。然后最后以0甘休测验,

 

详细代码:

#include<stdio.h>
int main()
{
    int a[100],t,i,sum;
    while(scanf("%d",&t)!=EOF)
    {
        if(t==0)
            break;
        sum=0;
        for(i=1;i<=t;i++)
        {
            scanf("%d",&a[i]);        
            sum=sum+a[i];
        }
        printf("%dn",sum);
    }
    return 0;
}

 

 

A+B for Input-Output Practice (V)

Time
Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K
(Java/Others) Total Submission(s): 39483    Accepted Submission(s):
26698

Problem Description

Your task is to calculate the sum of some integers.

 

Input

Input contains an integer N in the first line, and then N lines follow.
Each line starts with a integer M, and then M integers follow in the
same line.

 

Output

For each group of input integers you should output their sum in one
line, and with one line of output for each line in input.

 

Sample Input

2

4 1 2 3 4

5 1 2 3 4 5

 

Sample Output

10

15

 

ps:

 

题意:输入包含一个整数N在首先行,然后有N行测量检验用例,每生机勃勃行都始于叁个整数M,然后有M整数在同一个行。

每组输出整数之和且输出占意气风发行,大器晚成行输入风姿罗曼蒂克行输出。

 

反思:是还是不是前两题的成团体哈,再精心看看就知晓了。有木有!

 

详尽代码:

#include<stdio.h>
int main()
{
    int a[100],t,i,p,sum;
    scanf("%d",&p);
    while(p--)
    {
        scanf("%d",&t);
        if(t==0)
            break;
        sum=0;
        for(i=1;i<=t;i++)
        {
            scanf("%d",&a[i]);
            sum=sum+a[i];
        }
        printf("%dn",sum);
    }
    return 0;
}

 

 

A+B for Input-Output Practice (VI)

Time
Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K
(Java/Others) Total Submission(s): 37174    Accepted Submission(s):
25051

Problem Description

Your task is to calculate the sum of some integers.

 

Input

Input contains multiple test cases, and one case one line. Each case
starts with an integer N, and then N integers follow in the same line.

 

Output

For each test case you should output the sum of N integers in one line,
and with one line of output for each line in input.

 

Sample Input

4 1 2 3 4

5 1 2 3 4 5

 

Sample Output

10

15

 

 

ps:

 

那题就不要在啰嗦的在写题意了呢,貌似和方面包车型大巴主题素材太像了,,,,o(∩_∩)o
哈哈

详见代码:

#include<stdio.h>
int main()
{
    int a[100],t,i,sum;
    while(scanf("%d",&t)!=EOF)
    {
        sum=0;
        for(i=1;i<=t;i++)
        {
            scanf("%d",&a[i]);
            sum=sum+a[i];
        }
      printf("%dn",sum);
    }
    return 0;
}

见到这里作者只想说,大家做题时候,代码写的格式一定要正规,最棒正是情势统生机勃勃,该空的时候就空格,不然代码都二个水准就美貌了,并且现在比赛的时候你还会有2个队友,让她们给您检查错误的话,你的代码又不整洁,那么成效肯定不会高的,何况会有嫌恶的心境,那就越来越好了,所以大家今后写代码尽量标准一点。正是那样了!

 

 

 

 

A+B for Input-Output Practice (VII)

Time
Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K
(Java/Others) Total Submission(s): 36617    Accepted Submission(s):
24438

Problem Description

Your task is to Calculate a + b.

 

Input

The input will consist of a series of pairs of integers a and b,
separated by a space, one pair of integers per line.

 

Output

For each pair of input integers a and b you should output the sum of a
and b, and followed by a blank line.

 

Sample Input

1 5

10 20

 

Sample Output

6

 

30

 

ps:

 

题意:输入2个整数a和b,用空格分隔,每行风华正茂对整数。对于每生龙活虎对输入整数a和b你应有出口他们的总和,a和b,身后跟着一个空行。

 

是或不是又忘记空行了,输出的时候,本次又是高级中学级再台湾空中大学器晚成行哦,所以做题的时候自然要先看精通标题标现实要求在伊始工编织程,不然只会白白丢分!

 

详细代码:

#include<stdio.h>
int main()
{
    int a,b,sum;
    while(scanf("%d%d",&a,&b)!=EOF)
    {
        sum=a+b;
        printf("%dnn",sum);
    }
    return 0;
}

 

 

 

到底快甘休了,,,,,,搞得好劳累,我们鲜明要认真对待啊!

 

 

 

 

A+B for Input-Output Practice (VIII)

*Time
Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K
(Java/Others) Total Submission(s): 78908    Accepted Submission(s):
24263 *

Problem Description

 

Your task is to calculate the sum of some integers.

 

 

 

Input

Input contains an integer N in the first line, and then N lines follow.
Each line starts with a integer M, and then M integers follow in the
same line.

 

Output

For each group of input integers you should output their sum in one
line, and you must note that there is a blank line between outputs.

 

Sample Input

3

4 1 2 3 4

5 1 2 3 4 5

3 1 2 3

 

Sample Output

10

 

15

 

6

 

ps:

 

题意:输入包蕴贰个整数N在首先行,然后有N行测验数据。每意气风发行都起来都有二个整数M,然后后边有M个整数在同风流倜傥行。

每组输出整数之和,输出占意气风发行,你一定要小心,输出,每行之间有一个空行。

 

笔者只可以说这题就是地点几道难题的大聚合吧,所以是还是不是异常的粗略吗。哈哈,所以对于acm的输入输出是或不是装有驾驭了吧,

  对!正是那么粗略!so easy!    o(∩_∩)o   
那么,,,

 

 

还**是先看代码吧,**

#include<stdio.h>
int main()
{
    int a[100],t,i,p,sum;
    scanf("%d",&p);
    while(p--)
    {
        scanf("%d",&t);
        sum=0;
        for(i=1;i<=t;i++)
        {
            scanf("%d",&a[i]);        
            sum=sum+a[i];
        }
        printf("%dn",sum);
        if(p)//中间空行用
            printf("n");
    }
    return 0;
}

 

 

到将来甘休,你曾经学会acm的简约输入输出了,(当然不是兼顾的输入输出,这么些留给以往渐次学习好了,卡塔尔那么将来你已经能够在杭电上A题了,(为本身拍桌子,哈哈卡塔 尔(阿拉伯语:قطر‎,接下去我们可以从轻便题入手,自个儿建议可以先做11页的题。

理之当然不会的题应接到群内研商,QQ群:
 <首要面向刚刚入门的13级新生!>

最后还应该有叁个纤维提议:学习贵在百折不挠!刚刚起初都以比较难的,所以我们要互相鼓舞相互监督,协同进步!

          谢谢你的浏览!o(∩_∩)o

 

相关文章