LightOJ 1000 - Greetings from LightOJ

In this problem, we're asked to just add two input numbers and print them out accordingly. Here's the code.


#include <bits/stdc++.h>
using namespace std;

int main() {
  int T, i=1;
  scanf("%d", &T);
  while (T-- > 0) {
    int a, b;
    scanf("%d %d", &a, &b);
    printf("Case %d: %d\n", i++, a+b);
  }
  
  return 0;
}

No comments:

Post a Comment

Power function

In C/C++ (and also other languages), we have the built in power function to raise a number to a given power. What if we need to calculate ...