2014年8月9日

摘要: (1)#includeusing namespace std;int main(){ int k=0; int j; char b[20]; cout>b; for(j=0;j#include//这个头文件可以使用strlen函数using namespace std;... 阅读全文
posted @ 2014-08-09 13:59 Ji_xiaowu 阅读(729) 评论(0) 推荐(0) 编辑

2014年8月8日

摘要: #includeusing namespace std;int main(){ int n,temp; int k=0; int a[20]; cout>n; for(int i=0;i=1) { temp=n%10;//分离的关键步... 阅读全文
posted @ 2014-08-08 20:47 Ji_xiaowu 阅读(5085) 评论(0) 推荐(0) 编辑
摘要: #includeusing namespace std;int main(){ int sum=0; int a[3][3]; cout>a[i][j]; } } for(int m=0;m<3;m++) { sum+=a[m][m];... 阅读全文
posted @ 2014-08-08 20:24 Ji_xiaowu 阅读(2317) 评论(0) 推荐(0) 编辑
摘要: 1 2 3 4 55 1 2 3 44 5 1 2 33 4 5 1 22 3 4 5 1(1)运用循环嵌套,并设置中间变量转换//1、新建一个数组//2、输入内容并存储//3、输出结果#includeusing namespace std;int main(){ int temp; i... 阅读全文
posted @ 2014-08-08 20:03 Ji_xiaowu 阅读(1052) 评论(0) 推荐(0) 编辑
摘要: //1、定义一个3*3的二维数组//2、输入内容,并在屏幕中输出//3、运用for循环嵌套将数组转置,并输出(1)我的程序:运用中间量交换-错误版:转置算法有问题,需要好好模拟一下#includeusing namespace std;int main(){ int temp; int ... 阅读全文
posted @ 2014-08-08 18:00 Ji_xiaowu 阅读(1298) 评论(0) 推荐(0) 编辑
摘要: //1、建立二维数组//2、运用循环,将内容输入到数组中//3、求出最大元素,并输出行号和列号#includeusing namespace std;int main(){ int a[3][4]; int Max=0;//赋值之前需要先置为0 cout>a[i][j]; ... 阅读全文
posted @ 2014-08-08 17:57 Ji_xiaowu 阅读(6169) 评论(0) 推荐(0) 编辑
摘要: //1、学习到字符输入//2、判断字符#includeusing namespace std;int main(){ char a; cout>a; if(a>'0'&&a<'9') { cout<<"it's a numerical character!"<<... 阅读全文
posted @ 2014-08-08 11:28 Ji_xiaowu 阅读(945) 评论(0) 推荐(0) 编辑
摘要: //1、for循环+if判断//2、可设计成函数#includeusing namespace std;int ShuiXian(int);int main(){ for(int i=100;i<=999;i++) { if(ShuiXian(i)) { ... 阅读全文
posted @ 2014-08-08 11:19 Ji_xiaowu 阅读(582) 评论(0) 推荐(0) 编辑
摘要: //1、输入数字需要保存在数组中,注意数组的首元素问题//2、需要截取出各位数字//3、判断是哪一个数字//4、进行计数(1)我出错的程序:#includeusing namespace std;int main(){ int p[20]; int temp; int a=0,b=... 阅读全文
posted @ 2014-08-08 11:12 Ji_xiaowu 阅读(1039) 评论(0) 推荐(0) 编辑

2014年8月7日

摘要: 1.常用变量声明必须从以下当中选择:i,j,k,m,n,p,q(1)for 循环嵌套声明顺序:-两重嵌套:(i,j)->(m,n)->(p,q)-多重嵌套:i->j->k->m->n...(2)计数器一般采用k(3)中间变量一般采用temp,多个中间变量为temp1、temp2、temp3...(4... 阅读全文
posted @ 2014-08-07 20:40 Ji_xiaowu 阅读(203) 评论(0) 推荐(0) 编辑

导航