Educational Codeforces Round 56 (Rated for Div. 2) CodeForces - 1093A

题意大概就是,现在有一个骰子,面上的数字为2~7,然后给你一个x,问多少个总和为这个数字

答案不唯一,所以就让每个骰子都为2,答案就是x/2

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string.h>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<set>
#include<vector>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
const int maxn =1e5+5;
const int maxm=10000;
const int mod =1e9+7;
const int INF=0x3f3f3f3f;
const double eps=1e-8;

int main()
{
	int t;scanf("%d",&t);
	while(t--)
	{
		int x;scanf("%d",&x);
		printf("%d\n",x/2);
	}
    return 0;
}

猜你喜欢

转载自blog.csdn.net/wzazzy/article/details/85040401
今日推荐