3911 - a + b
Your task is to calculate the sum of two nembers.
<br />
Input
Input contains an integer N in the first line,and then n lines follows;Each line contains
two nembers.
Output
For each group of input nembers,you should output their sum with the accuracy of two decimal digits after the point in one line ,and you must notice that there is a blank between outputs;
Examples
Input
1 839.08 999.91
Output
1838.99
Solution C
#include<stdio.h> int main() { int t; scanf("%d",&t); double a,b; while(t--) { scanf("%lf%lf",&a,&b); if(t==0) printf("%.2lf\n",a+b); else printf("%.2lf\n\n",a+b); } return 0; }
Solution C++
#include<stdio.h> int main() { int i,n; double a,b; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%lf%lf",&a,&b); printf("%.2f",a+b); printf("\n\n"); } return 0; }