【DidaOJ】[1130]Thanksgiving KK Special - A Gift for Freshmen

Problem Description

Loading...

Problem Analysis

​ Just write out the expression and compute it directly.

cpp
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#include<stdio.h>
int main(){
    int t,b,g;
    scanf("%d",&t);
    while(t--){
    scanf("%d %d",&b,&g);   
    if(g==0)
    printf("0\n");
    else
    printf("%d\n",b+2*g);
    }
    return 0;
}

Problem link: [DidaOJ] [1130] Thanksgiving KK Special — A Gift for Freshmen

Loading...