题目:Dice Rolling
思路:直接输出 x/7 + (x/7!=0)
代码:
#include<bits/stdc++.h>
using namespace std;#define read(t) scanf("%d",&t)int main() {
int t;read(t);while(t--) {
int x;read(x);int ans=0;ans+=x/7;if(x%7) ans++;printf("%d\n",ans);}return 0;
}
题目:Dice Rolling
思路:直接输出 x/7 + (x/7!=0)
代码:
#include<bits/stdc++.h>
using namespace std;#define read(t) scanf("%d",&t)int main() {
int t;read(t);while(t--) {
int x;read(x);int ans=0;ans+=x/7;if(x%7) ans++;printf("%d\n",ans);}return 0;
}