您的位置:首页 > 其它

输出任意次方的后三位数

2016-11-29 18:16 197 查看
#include<stdio.h>

int main()

{

    int x,y,i,p=1;

    scanf("%d%d",&x,&y);

    for(i=1;i<=y;i++)

    {

        p*=x;

    }

    p=p%1000;

    if(p>99)

        printf("%d\n",p);

    else if(p>9)

        printf("0%d\n",p);

    else

        printf("00%d\n",p);

    return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐