KIDZEE1B - Sum It Up

no tags 

In this problem, you will be given 3 integer numbers x, y, z as input (absolute value of x, y and z will be less than 1000). Your job is to print their sum.

এই প্রবলেমে, তোমাকে তিনটা পূর্ণসংখ্যা (ইন্টিজার নাম্বার) x, y, z দেয়া থাকবে ইনপুট হিসেবে। (x, y, z এর পরম মান 1000 থেকে ছোটো হবে)। সংখ্যা তিনটির যোগফল আউটপুট হিসেবে প্রিন্ট কর।

Input

The first line of input consists of a number T, denoting the number of test cases. There will be next T lines. Each line will contain 3 integers. Your code might look like below:

ইনপুটের প্রথম লাইনে একটা সংখ্যা, T, দেয়া থাকবে।T নির্দেশ করে এরপরে কয়টি টেস্ট কেইস আছে।এর পরবর্তী T সংখ্যক লাইনের প্রত্যেকটিতে তিনটি করে সংখ্যা দেয়া থাকবে। তোমার কোডটা দেখতে অনেকটা নিচের কোডটার মতো হতে পারে।

#include

int main()

{

     int testcase, i, x, y, z, sum;

     int caseno = 1;

     scanf(“%d”,&testcase);

     for(i = 1; i <= testcase; i++)

     {

          //write lines here to take input in x, y, z

          //write lines to keep the sum of x, y and z in sum variable

          printf(“Case %d: ”, caseno);

          caseno++;

          //write lines here to print the desired output

          printf(“\n”);

     }

return 0;

}

Output

For each input case, first, print the case number. Then print a line “Sum of x, y and z is sum”. Here, x, y and z will be replaced according to the given input. And sum will be the summation result of x, y and z. See the sample input output for more details.

প্রত্যেকটা ইনপুট কেইসের জন্যে, তোমাকে প্রথমে টেস্টকেইস নাম্বার প্রিন্ট করতে হবে। এর পরে একটি লাইন প্রিন্ট করতে হবে, যার ফরম্যাট হবে এরকম : “Sum of x, y and z is sum”. এখানে, x, y এবং z কে যথক্রমে ইনপুটে দেয়া প্রথম, দ্বিতীয়, তৃতীয় সংখ্যা এবং তাদের যোগফল দিয়ে প্রতিস্থাপন করতে হবে। আরো বিস্তারিত উদাহরণের জন্যে নিচের নমুনা ইনপুট আউটপুট দেখতে পারো।

Example

Input:
3
3 5 4
4 -2 10
500 500 500

Output:
Case 1: Sum of 3, 5 and 4 is 12
Case 2: Sum of 4, -2 and 10 is 12
Case 3: Sum of 500, 500 and 500 is 1500

hide comments
Shafaet: 2016-09-20 22:13:28

@dsr: it is allowed.

dsr: 2015-04-21 07:00:16

Why isn't C++ allowed?


Added by:Shafaet
Date:2013-01-09
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM32-GCC ASM64 MAWK BC C-CLANG NCSHARP CPP14 CPP14-CLANG COBOL COFFEE D-CLANG D-DMD DART ELIXIR FANTOM FORTH GOSU GRV JS-MONKEY JULIA KTLN NIM OBJC OBJC-CLANG OCT PICO PROLOG PYPY PYPY3 R RACKET RUST CHICKEN SQLITE SWIFT UNLAMBDA VB.NET
Resource:Own problem - Used for Junior Training