问题 F: Sandglass2
时间限制: 1 Sec 内存限制: 128 MB
提交: 343 解决: 212
[提交] [状态] [讨论版] [命题人:admin]
题目描述
We have a sandglass that runs for X seconds. The sand drops from the upper bulb at a rate of 1 gram per second. That is, the upper bulb initially contains X grams of sand.
How many grams of sand will the upper bulb contains after t seconds?
Constraints
1≤X≤109
1≤t≤109
X and t are integers.
输入
The input is given from Standard Input in the following format:
X t
输出
Print the number of sand in the upper bulb after t second.
样例输入
100 17
样例输出
83
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
int x,t;
cin>>x>>t;
if(x>=t)
printf("%d\n",x-t);
else
cout<<"0"<<endl;
return 0;
}