Input Output Sample - 01
The Input
Input starts with an integer T, denoting the number of test cases. Each test case will contain two integers a and b.
The Output
For each test case, output one line in the format "Case x: c" (quotes for clarity), where x is the case number and c is the sum of a and b.
Sample Input
2
5 10
9 4
Sample Output
Case 1: 15
Case 2: 13
C Code
#include <stdio.h> int main(){ int cas,i,a,b,c; scanf("%d",&cas); for(i=1;i<=cas;i++){ scanf("%d %d",&a,&b); c=a+b; printf("Case %d: %d\n",i,c); } return 0; }
C++ Code
#include <iostream> using namespace std; int main(){ int cas,i,a,b,c; cin>>cas; for(i=1;i<=cas;i++){ cin>>a>>b; c=a+b; cout<<"Case "<<i<<": "<<c<<endl; } return 0; }