摘要: #include#includeusing namespace std;void main(){int i,j;//cout>i>>j;int m=abs(i-j);int n=i+j;int a=(int)sqrt(m);//开不尽取整之后精度丢失。平方不等mint b=(int)sqrt(n);... 阅读全文
posted @ 2014-03-27 18:18 lz3018 阅读(174) 评论(0) 推荐(0) 编辑
摘要: #includeusing namespace std;int main(){const int m=15;int a[m][m],i,j;//int a[9][9]9行9列的二位数组,a[0][0]~a[8][8],因此下面输出数组内容到a[9][9]会异常,利用VC++编译结果正常显示但//提示... 阅读全文
posted @ 2014-03-27 18:17 lz3018 阅读(122) 评论(0) 推荐(0) 编辑
摘要: // 十进制转化为各进制.cpp : Defines the entry point for the console application.//#include #includeusing namespace std;int main(){while(1){int input;cout>input... 阅读全文
posted @ 2014-03-27 18:16 lz3018 阅读(161) 评论(0) 推荐(0) 编辑
摘要: // 十进制转化为各进制.cpp : Defines the entry point for the console application.//#include #includeusing namespace std;int main(){while(1){int input;cout>input... 阅读全文
posted @ 2014-03-27 18:15 lz3018 阅读(149) 评论(0) 推荐(0) 编辑
摘要: #include#includeusing namespace std;void buddle(char*,int);//对输入字符的AScII进行排序void delete_num(char*,int);//去除已排好顺序中重复的字符.int main(){ while(1){char s[30]... 阅读全文
posted @ 2014-03-27 18:13 lz3018 阅读(163) 评论(0) 推荐(0) 编辑
摘要: #includeusing namespace std;#define N a//定义宏时后面不加;否则会把‘;’一起定义为宏.int getP(int,int);//int getWel(int,int*);int main(){while(1){int numbers;cout>numbers;... 阅读全文
posted @ 2014-03-27 18:12 lz3018 阅读(122) 评论(0) 推荐(0) 编辑
摘要: /*#includeusing namespace std;int main(){int sum[3000]={0};for(int i=1;imain(){ int i,a,b,n; for(a=1;ausing namespace std;int main(){for(int i=1;i... 阅读全文
posted @ 2014-03-27 18:11 lz3018 阅读(145) 评论(0) 推荐(0) 编辑
摘要: #includeusing namespace std;int main(){int fish_sum,flag=1;for(fish_sum=6;flag;fish_sum++){int i=1;for(int x=fish_sum;i<=5;i++){{if((x-1)%5==0)x=4*(x-... 阅读全文
posted @ 2014-03-27 18:10 lz3018 阅读(97) 评论(0) 推荐(0) 编辑
摘要: /*#includeusing namespace std;void input();int counter=0,jishu_sum=0,oushu_sum=0,sum=0;int input_num[20];int main(){cout=0);do{int oushu=input_num[ous... 阅读全文
posted @ 2014-03-27 18:10 lz3018 阅读(134) 评论(0) 推荐(0) 编辑
摘要: //假设32位int型变量y是表示最大人数的x的阶乘,即y=x!,当x最大值取什么时,y取最大值//,且乘法不溢出。#includeusing namespace std;unsigned int Fun(unsigned int);int main(){unsigned int max_perso... 阅读全文
posted @ 2014-03-27 18:08 lz3018 阅读(162) 评论(0) 推荐(0) 编辑
摘要: #include#includeusing namespace std;int main(){//cout>input;int num_form;/*while(input/2!=0){input=input/2;bite_num++;//bite_num的值即为二进制位数}*/char bite[... 阅读全文
posted @ 2014-03-27 18:06 lz3018 阅读(141) 评论(0) 推荐(0) 编辑
摘要: #includeusing namespace std;int main(){char ch=128;//VC编译器默认是有符号的。但c并未明确给出。由编译器自身确定.int a=ch;cout<<(int)ch;//利用cout输出字符变量是,变量值必须是return 0;}//对于C++中的ch... 阅读全文
posted @ 2014-03-27 08:34 lz3018 阅读(616) 评论(0) 推荐(0) 编辑