- 博客(12)
- 收藏
- 关注
原创 期末刷oj——泡泡
#include#include using namespace std;int main(){ char str[81]; gets(str); int i=0; while(str[i]!='\0') { if((str[i]>='a'&&str[i]='A'&&str[i]<='Z')) {
2014-12-28 11:46:34 530
原创 期末刷oj——找出素数
#include #include using namespace std;bool isPrime(int n);int main( ){ int n; while(cin>>n) { if(isPrime(n)) cout<<n<<endl; } return 0;}b
2014-12-28 11:41:19 626
原创 期末刷oj ——用数字造数字
#include using namespace std;int main( ){ int n,arr[15],num=0; int i,max1,max2,min1,min2,t; cin>>n; while(n>0) { arr[num++]=n%10; n/=10; }for(i=
2014-12-28 11:36:41 620
原创 第十六周项目三——用函数指针调用函数
#include using namespace std;void eat();void sleep();void hitdoudou();void run(void (*f)());int main(){ int iChoice; do { cout<<"请选择(1-吃;2-睡;3-打;其他-退)";
2014-12-15 11:35:28 524
原创 第十六周项目二——用指针玩字符串(2)
/* *Copyright (c) 2014,烟台大学计算机学院 *All rights reserved. *文件名称: test.cpp *作 者:陈丹 *完成日期:2014年12月15日 *版本号:v1.0 * *问题描述: *输入描述: *程序输出: */#include using namespace st
2014-12-15 11:08:15 478
原创 第十六周项目二——用指针玩字符串(1)
/* *Copyright (c) 2014,烟台大学计算机学院 *All rights reserved. *文件名称: test.cpp *作 者:陈丹 *完成日期:2014年12月15日 *版本号:v1.0 * *问题描述: *输入描述: *程序输出: #include using namespace std;
2014-12-15 10:59:46 512
原创 第十六周项目一——数组的排序
/* *Copyright (c) 2014,烟台大学计算机学院 *All rights reserved. *文件名称: test.cpp *作 者:陈丹 *完成日期:2014年12月15日 *版本号:v1.0 * *问题描述: *输入描述: *程序输出: */#include using namespace st
2014-12-15 10:57:08 523
原创 第十六周项目——oj2
/* *Copyright (c) 2014,烟台大学计算机学院 *All rights reserved. *文件名称: test.cpp *作 者:陈丹 *完成日期:2014年12月15日 *版本号:v1.0 * *问题描述: *输入描述: *程序输出: */#include using namespace st
2014-12-15 10:54:46 493
原创 第十六周项目——oj1
/* *Copyright (c) 2014,烟台大学计算机学院 *All rights reserved. *文件名称: test.cpp *作 者:陈丹 *完成日期:2014年12月15日 *版本号:v1.0 * *问题描述: *输入描述: *程序输出: */#include using namespace s
2014-12-15 10:52:20 487
原创 第十五周项目——oj d
#include using namespace std;void ast(int x,int y,int *cp,int *dp){ *cp=x+y; *dp=x-y; return;}int main( ){ int a,b,c,d; cin>>a>>b; ast(a,b,&c,&d); cout<<c<<" "<<d<<endl;
2014-12-08 15:24:11 558
原创 第十五周项目——oj c
#include using namespace std;void jiaohuan(int *p1, int *p2);int main( ){ int a,b; cin>>a>>b; jiaohuan(&a,&b); cout<<a<<" "<<b<<endl; return 0;}void jiaohuan(int *p1, int *p2
2014-12-08 15:22:55 539
原创 第十五周项目——oj b
#include using namespace std;int main( ){ int *p1,*p2,t; //本程序以下不准再加入新的变量,下面用new操作符分配空间,并用p1、p2分别保存其地址 p1=new int; p2=new int; //下面输入两个整数。若无上面分配的空间,这样操作指赂的空间,极其危险 cin>>*p1>>
2014-12-08 15:21:16 572
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人