4 solutions
-
-2
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int a=n/4;//可以买的4块的笔的数量 int r=n%4;//买了4块的笔以后剩余的笔的数量 int b=0,c=0;//b表示五块的笔,c表示六块的笔的数量 switch(r) { case 1: b=1,a--; break; case 2: c=1,a--; break; case 3: b=1,c=1,a-=2; break; } cout<<c<<" "<<b<<" "<<a; return 0; }
- 1
Information
- ID
- 42
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 1
- Tags
- (None)
- # Submissions
- 161
- Accepted
- 56
- Uploaded By