hdu 1014 Uniform Generator(输出格式控制)

来源:互联网 发布:网络摄像机接线 编辑:程序博客网 时间:2024/05/14 11:58
#include<iostream>#include<cstdio>using namespace std;int main(){    int step,mod,step1,mod1;    while(scanf("%d%d",&step,&mod)!=EOF)    {        step1=step;mod1=mod;        while(mod1!=0)        {            int r=step1%mod1;            step1=mod1;            mod1=r;        }        if(step1==1)        printf("%10d%10d    Good Choice\n\n",step,mod);//注意右对齐方式,前面连上数字和空格,一共10个字符(step)同理,mod也占10个,而后面Good choice是左对齐,从第25个字符开始//注意是4个空格               else        printf("%10d%10d    Bad Choice\n\n",step,mod);    }    return 0;}

原创粉丝点击