0
点赞
收藏
分享

微信扫一扫

step1_入门_ACM入门练习 整数的尾数

蒸熟的土豆 2022-02-11 阅读 78


​​http://acm.hdu.edu.cn/showproblem.php?pid=2099​​

AC代码

#include<iostream>
#include<iomanip>
using namespace std;
int main(){
int n=0,m=0;
while(cin>>n>>m&&n!=0&&m!=0){
n*=100;
int k=(n/m)*m;
if(k<n)k+=m;
bool flag=true;
while(k<=n+99){
if(flag)
cout<<setw(2)<<setfill('0')<<k%100;
else
cout<<" "<<setw(2)<<setfill('0')<<k%100;
flag=false;
k+=m;
}
cout<<endl;
}
return 0;
}



举报

相关推荐

0 条评论