- 博客(15)
- 资源 (2)
- 收藏
- 关注
原创 山东理工ACM 1188 C语言实验——各位数字之和排序
<br />http://acm.sdut.edu.cn/judgeonline/showproblem?problem_id=1188<br />#include<iostream><br />using namespace std;<br />int main()<br />{ <br /> int n,sum,a[100],sm[100],i,j,k,t;<br /> while(cin>>n)<br /> {<br /> if(n==0) break;<br />
2010-10-17 14:45:00
2715
翻译 山东理工ACM 1603 Least Common Multiple
<br />http://acm.sdut.edu.cn/judgeonline/showproblem?problem_id=1603<br />#include<iostream><br />using namespace std;<br />int multiple(long a,long b)<br />{//最小公倍数函数<br /> int c,p,q;<br /> p=a;<br /> q=b; //a,b不用交换也行;<br /> while(c=a%b)<br /> {<br
2010-10-15 20:10:00
1213
原创 山东理工ACM 1634 分解素因子
http://acm.sdut.edu.cn/judgeonline/showproblem?problem_id=1634#include#includeusing namespace std;int su(int m) //判断素数的函数{ int t,j; t=sqrt(m); //判断m是不是素数 for(j=2;j if(m%j==0) break; if(j>t) return 1; else return 0;}int main(){ in
2010-10-14 14:45:00
1538
翻译 山东理工ACM 1623 一只小蜜蜂
<br />http://acm.sdut.edu.cn/judgeonline/showproblem?problem_id=1623<br />#include<stdio.h><br />int main()<br />{<br /> int A,B,i,j,n,m;<br /> __int64 c[100];<br /> scanf("%d",&m);<br /> for(i=1;i<=m;i++)<br /> {<br /> scanf("%d%d",&A,
2010-10-13 10:40:00
1707
原创 杭电 1196 Lowest Bit (逻辑与的运算)
<br />http://acm.hdu.edu.cn/showproblem.php?pid=1196<br />#include<iostream><br />using namespace std;<br />int main()<br />{ <br /> int n,i,t,a[7]={1,2,4,8,16,32,64};<br /> while(cin>>n,n)<br /> {<br /> for(i=0;i<7;i++)<br />
2010-10-11 20:58:00
493
原创 (栈的习题)杭电 1877 又一版A+B
<br />http://acm.hdu.edu.cn/showproblem.php?pid=1877<br />#include<iostream><br />#include<stack><br />using namespace std;<br />int main()<br />{<br /> stack<long int>s; //定义栈<br /> long int m,a,b,n;<br /> while(cin>>m)<br /> { if(m==0) break; <br />
2010-10-09 23:39:00
591
原创 杭电 1013 Digital Roots (栈的做法)
http://acm.hdu.edu.cn/showproblem.php?pid=1013#include#include#includeusing namespace std;int main(){ int n,sum,i,t; string str; stacks; while(cin>>str) { t=0; for(i=0;str[i]!='/0';i++) t=t+str[i]-48; if(t==0) break; while(t>=10
2010-10-09 17:25:00
404
原创 栈的习题:山东理工ACM 2131 进制转换
#include#includeusing namespace std; int main() { int a,b; cin>>a>>b; stacks; while(a) { s.push(a%b); a=a/b; } while(!s.empty() ) { cout
2010-10-08 19:16:00
1347
1
原创 山东理工ACM 2117 逆序建立链表
#include<stdio.h><br />struct lian<br />{<br /> int num;<br /> lian *next;<br />};<br />int main()<br />{<br /> int i,n;<br /> lian *p,*pt;<br /> p=new lian;<br /> p->next=NULL;<br /> pt=p;<br /> scanf("%d",&n);<br /> for(i=1;i<=n;i++)<br /> {<br /> p=new
2010-10-08 19:11:00
1565
原创 山东理工ACM 2116 顺序建链表
#includestruct lian{ int num; lian *next;};int main(){ int n,i; lian *p,*head,*pnext; scanf("%d",&n); for(i=1;inext=p; pnext=p; scanf("%d",&p->num); } pnext->next=NULL; p=head; while(p->next)
2010-10-08 18:55:00
1997
原创 杭电1229 还是A+B
#include#includeusing namespace std;int main(){ int a,b,t,k; while(cin>>a>>b>>k) { if(a==0&&b==0) break; t=pow(10,k); //10的k次幂 if(a%t==b%t) //判断后K位是否相等 cout else cout } return 0;}
2010-10-07 16:01:00
398
原创 杭电 1040 As Easy As A+B
<br />#include<iostream><br />using namespace std;<br />long a[1000];<br />int main()<br />{ long n,i,m,j,k,head,t;<br /> cin>>n;<br /> for(i=1;i<=n;i++)<br /> { <br /> cin>>m;<br /> for(j=1;j<=m;j++)//输入 a【j】<br /> cin>>a
2010-10-07 09:17:00
412
原创 杭电ACM 1021 Fibonacci Again
<br />#include<stdio.h><br />long int f[10000000];<br />int main()<br />{ long int i,n;<br /><br /> while(scanf("%ld",&n)!=EOF)<br /> {<br /> if(n%4==2) //有规律可循<br /> printf("yes/n");<br /> else<br /> printf("no/n");<br /
2010-10-07 09:08:00
507
原创 杭电ACM 1096 A+B for Input-Output Practice (VIII)
<br />#include<iostream><br />using namespace std;<br />int main()<br />{ int i,n,m,sum,a[100],j;<br /> cin>>n;<br /> for(i=1;i<=n;i++)<br /> {<br /> cin>>m;sum=0;<br /> for(j=1;j<=m;j++)<br /> {<br /> cin>>a[j];<br />
2010-10-07 09:02:00
435
原创 杭电ACM1003 Max Sum
杭电ACM1003 Max Sum Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-
2010-10-06 20:22:00
758
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人