【2012四川省热身赛】Problem A. A - B Problem
来源:互联网 发布:js 字符串在数组中 编辑:程序博客网 时间:2024/05/13 11:00
Description
Calculate |a − b|
Input
The first line of input is a single number T(T ≤ 100),means the number of test cases.Then T cases
followed, each case contains only one line with two integers A and B(0 ≤ A;B ≤ 100).
Output
For each test case,you should output one line. First, output “Case #t: ”, t means the number of
the test case which is from 1 to T. Then, output an integer indicates the value of |a − b|.
Sample Input
21 63 2
Sample Output
Case #1: 5Case #2: 1
HINT
#include<stdio.h>
int main ()
{
int a,b,c,i;
scanf("%d\n",&a);
for(i=0;i<a;i++)
{
scanf("%d %d",&b,&c);
if(b>c)
{
printf("Case #%d: %d",i+1,b-c);
}
else
printf("Case #%d: %d",i+1,c-b);
printf("\n");
}
}
- 【2012四川省热身赛】Problem A. A - B Problem
- problem 1000: A+B problem
- Problem 1000 A+B Problem
- Problem - 1000 A + B Problem
- A + B Problem
- A + B Problem
- 1000 A+B Problem
- 1001 A + B Problem
- A+B Problem
- 1000 A+B Problem
- A + B Problem
- A + B Problem
- 1000 A + B Problem
- 1000 A+B Problem
- A + B Problem
- A + B Problem II
- A + B Problem II
- POJ1001 -- A-B Problem
- velocity的基础语法
- Android项目-几种常见的应用Tab架构
- Android重写view时onAttachedToWindow () 和 onDetachedFromWindow ()
- 春哥打校赛一 杯具了
- PASSWORD,ENABLE,CONSOLE,VTY及TACACS认证顺序及区别
- 【2012四川省热身赛】Problem A. A - B Problem
- 从零开始学C++之类与对象:类声明、类作用域、前向声明、this指针、嵌套类、PIMPL 技法 等
- Hadoop的Reducer不运行
- A+B Problem
- cxf spring 整合使用示例
- 统计的力量
- 《信号与线性系统分析》 吴大正 (与电子、通信专业的同学共勉)
- Hibernate 使用原生SQL进行查询
- 02-计算字符串的实际长度(字符串处理)