您的位置:首页 > 其它

CrodeForces 851A--#432 Div2 A

2017-09-07 23:54 316 查看
#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include <list>
#define INF 0x3f3f3f
#define maxn 1050
#define juzheng 300

#define ll long long

using namespace std;

//Date:2017-9-5
//Author:HarryBlackCat

int n,k,t;

int main(){
while(~scanf("%d %d %d",&n,&k,&t)){
if(t == 0 || t == n + k)//0或n + k 时为0
printf("0\n");
else if(t > 0 && t <= k)//1->k时为t
printf("%d\n",t);
else if(t > k && t <= n)//(k + 1)->n时为k
printf("%d\n",k);
else if(t > n && t < n + k)// (n + 1)->(n + k)是为 k - (t - n)
printf("%d\n",k - (t - n));
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: