上一页 1 ··· 5 6 7 8 9 10 11 12 下一页
摘要: include irvine32.inc.datavar1 dword 4 dup(0,0,0,0);str1 byte "请用16进制输入一个大整数(最高位为96位)",0;str2 byte "结果为:",0;str3 byte "请输入2的次方数(十进制--不能超过31):",0;i dword 0;j dword 0;str4 byte "输入的绝对值为:",0.codemain procL4: mov dword ptr var1+12,0; mov j,0;正负数的标志;0为正数,1为负数; mov e 阅读全文
posted @ 2013-02-25 19:03 叶城宇 阅读(284) 评论(0) 推荐(0) 编辑
摘要: //输入一个大于6的偶数,这个数一定能写成两个素数的和,比如8=3+5;#include<iostream>using namespace std; int prime(int x);void gotbaha(int x);void main(){ int a; cin>>a; if((a<6)||(a%2==1)) cout<<"the wrong number"<<endl; else gotbaha(a); }int prime(int x){ int i;for(i=2;i<x;i++) if(x%i==0 阅读全文
posted @ 2013-02-23 16:02 叶城宇 阅读(190) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;class School{private: char*sname; int snumber,score;public: void show( ) {cout<<"sname is:"<< sname<<endl; cout<<"snumber is:"<< snumber<<endl; cout<<"score is:"<< score<<e 阅读全文
posted @ 2013-02-23 16:01 叶城宇 阅读(139) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;#include<cmath>class number {private :int son,mother;public: number (int son2,int mother2) { int a,b,k,i=0; if(son2>mother2) { a=son2;b=mother2;} else {a=mother2;b=son2;} for( ; ;i++) {if(a%b==0) break; else { k=a;a=b;b=k%b;} } son=s... 阅读全文
posted @ 2013-02-23 16:00 叶城宇 阅读(202) 评论(0) 推荐(0) 编辑
摘要: //应用调用函数的引用,将一维数组的最大值换成自己输入的一个X的数,再将数组输出;# include <iostream>using namespace std;int &fun(int a[],int b);int* max;void main (void){ int a[]={5,9,8,7,12,33,66,88,7},n,x; cout<<"please enter x"<<endl; cin>>x; n=sizeof(a)/sizeof(int); fun(a,n)=x; for(int i=0;i<n 阅读全文
posted @ 2013-02-23 15:59 叶城宇 阅读(153) 评论(0) 推荐(0) 编辑
摘要: # include <iostream>using namespace std;void move (int n,char a,char b){ cout<<n<<"盘"<<a<<" to "<<b<<endl;}void h1(int n,char x,char y,char z){ if(n==1) move(n,x,z); else { h1(n-1,x,y,z); move (n,x,z); h1(n-1,y,x,z); }}void main (){ int n 阅读全文
posted @ 2013-02-23 15:56 叶城宇 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;char dest[10] ;char* copystr(char source[], int m ,int x) { int i,j=0; for(i=m-1;i<x;i++) { dest[j]=source[i]; j++;} char *p=dest; return p; }void main(){ int i,m,x; char source[10] ; for(i=0;i< 10;i++) cin>>source[i]; cout<<"请输入0-10 阅读全文
posted @ 2013-02-23 15:55 叶城宇 阅读(150) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;void copystr(char source[],char dest[],int m ,int x) { int i,j=0 ; for(i=m-1;i<x;i++) { dest[j]=source[i]; j++;} }void main(){ int i,m,x; char source[10],dest[10]; for(i=0;i< 10;i++) cin>>source[i]; cout<<"请输入0-10之间的数"<<en 阅读全文
posted @ 2013-02-23 15:54 叶城宇 阅读(156) 评论(0) 推荐(0) 编辑
摘要: //某任务需要在A、B、C、D、E着5人中物色人员去完成,但派人受限于下列条件://(1)若A去,则B跟去(2)D、E两人中必有人去(3)B,C两人中必有人去,但只去一人//(4)C,D两人要么都去,要么都不去(5)若E去,则A,B都去#include<iostream>using namespace std;void print(int n);void main(){ for(int i=0;i<32;i++){ if(i>>4 && !((i & 8) ))continue; if(!((i&2) ) &&!(i 阅读全文
posted @ 2013-02-23 15:45 叶城宇 阅读(144) 评论(0) 推荐(0) 编辑
摘要: //某任务需要在A、B、C、D、E着5人中物色人员去完成,但派人受限于下列条件://(1)若A去,则B跟去(2)D、E两人中必有人去(3)B,C两人中必有人去,但只去一人//(4)C,D两人要么都去,要么都不去(5)若E去,则A,B都去#include<iostream>using namespace std;void print(int n);void main(){ for(int i=0;i<32;i++){ bool A=i&16,B=i&8,C=i&4,D=i&2,E=i&1; if(A && !B) cont 阅读全文
posted @ 2013-02-23 15:44 叶城宇 阅读(256) 评论(1) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 下一页