poj 1047 Round and Round We Go
来源:互联网 发布:神经网络算法知乎 编辑:程序博客网 时间:2024/05/22 11:30
简单的高精度模拟。
#include <iostream>#include <cstdio>#include <cstring>using namespace std;int main(){ char s[200],sc[200]; while(scanf("%s",s)!=EOF) { int len=strlen(s),flag=1,i,j,k=0; for(i=1; i<=len; i++) { memset(sc,0,sizeof(sc)); int c=0,r=0; for(j=len-1; j>=0; j--) { r=(s[j]-'0')*i+c; sc[j]=r%10+'0'; c=r/10; } //cout<<sc<<endl; if(c!=0) { flag=0; break; } for(k=0; k<len; k++) { if(strcmp(s,&sc[k])==0) break; else sc[k+len]=sc[k]; } if(k>=len) { flag=0; break; } } if(flag) cout<<s<<" is cyclic"<<endl; else cout<<s<<" is not cyclic"<<endl; } return 0;}
0 0
- Round and Round We Go POJ 1047
- poj 1047 Round and Round We Go
- poj 1047 Round and Round We Go
- POJ 1047 Round and Round We Go
- POJ 1047 Round and Round We Go
- poj 1047 Round and Round We Go
- POJ 1047 Round and Round We Go
- poj 1047-Round and Round We Go
- POJ 1047 Round and Round We GO
- poj 1047 Round And Round We Go
- POJ 1047 Round and Round We Go
- POJ 1047 Round and Round We Go 循环数新解
- poj 1047 Round and Round We Go 字符串的处理
- POJ 1047 Round and Round We Go (大数乘法) 水
- POJ 1047 Round and Round We Go 已被翻译
- Round and Round We Go
- Round and Round we go
- Round and Round We Go
- Sublime Text 2 设置文件详解
- 张小娴经典语录
- C语言register关键字—最快的关键字
- 我们工作到底为了什么
- Asp.net MVC中的ViewData与ViewBag
- poj 1047 Round and Round We Go
- UML初识之用例图和类图
- NSNotificationCenter
- android之service
- android PULL解析XML
- windows下node.js及express的安装
- TCP的FIN/RST Cookie
- 激烈交锋去了过来啊发 篮球了 了家里蓝精灵 家里就
- 细说Android事件传递机制(dispatchTouchEvent、onInterceptTouchEvent、onTouchEvent)