13 条题解
- 1
信息
- ID
- 811
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 5
- 标签
- 递交数
- 1460
- 已通过
- 538
- 上传者
#include<bits/stdc++.h>
const int N=1e5+10;
using namespace std;
int main(){
int a,b,c;//a表示跳绳数,b表示减去数
cin>>a>>c;
if(a%c==0){
cout<<a/c;
}
if(a%c!=0){
b=a%c;
a=a-b;
cout<<b<<" "<<a/c;
}
if(a==0&&b==0)
cout<<"0";
return 0;
}
然后,你错了😄
帮忙看看哪错了,谢谢呗,好心人
col1 | col2 | col3 |
---|---|---|
#1 | Wrong Answer Standard answer longer than user output. | |
#2 | Accepted | 1ms |
#3 | 0ms | |
#4 | ||
#5 | ||
#6 | 1ms | |
#7 | ||
#8 | ||
#9 | 0ms | |
#10 | ||
#include <stdio.h> #include using namespace std; int main() { int a,b cin>>a>>b cout<<a%b<<" "<<a/b;
return 0;
}
#include <stdio.h> #include using namespace std; int main() { int a,b; cin>>a>>b; cout<<a%b<<" "<<a/b;
return 0;
}
#include using namespace std; int main() { int a,b,c,d; cin>>a>>b; c=a%b; d=(a-c)/b; cout<<c<<" "<<d; }
先用数学的方式理解
#include <stack>
#include <iostream>
#include <iomanip>
#include <string.h>
#include <algorithm>
using namespace std;
int main()
{
int n,m,a,b,c;
cin>>n>>m;
a=n/m;
c=a*m;
b=n-c;
cout<<b<<" "<<a;
}