摘要:
#include <iostream>#include <cstring>#include <string>using namespace std;int main(){ int n,c,i,j,h[10]; //n用来存储字符串长度,i j用来计数,h存放查找的字符串出现的位置 char st[100],s,z[20],x[20],m; //s在空格转换和判断是否是用到,m判断是用到,z x用来存放要查询的字符串 cout<<"请输入一段英文句子:"; gets(st); n=strlen(st); while(st[n-1 阅读全文
posted @ 2009-06-26 16:14
CMuYu
阅读(182)
评论(0)
推荐(0)
摘要:
#include <iostream>#include <ctime>#include <cstdlib>using namespace std;int main(){ int x,y,z,i,l,b,a,c=0; char h; cout<<"是否要进行测试?(y/n):"; cin>>h; //srand(time(null)); while(h=='y') { do {cout<<"请选择要测试的类型(1:加法;2:减法;3:乘法):"; cin>> 阅读全文
posted @ 2009-06-26 16:12
CMuYu
阅读(143)
评论(0)
推荐(0)
摘要:
#include <iostream>using namespace std;class student{ int number; char name[10]; int computer,math,english,physics; public: bool eq(int n) { if(number==n) return true; else return false; } void dele() { number=-1; } void input() { cout<<"学号:"; cin>>number; cout<<&qu 阅读全文
posted @ 2009-06-26 16:08
CMuYu
阅读(150)
评论(0)
推荐(0)
摘要:
#include<iostream>using namespace std;#define N 8 //改成8就是八皇后了class Queen{ friend int nQueen(int); private: void Print(int x[]); bool Place(int k); void Backtrack(int t); int n, *x; long sum;};bool Queen::Place(int k){ int j; for(j=1;j<k;j++) if((abs(k-j)==... 阅读全文
posted @ 2009-06-26 16:05
CMuYu
阅读(178)
评论(0)
推荐(0)
摘要:
#include <iostream>using namespace std;bool hang(char xq[][9],int x) //行是否被攻击{ for(int u=0;u<8;u++) { if(xq[x][u]=='*') break; } if(xq[x][u]=='*') return false; else return true;}bool lie(char xq[][9],int y) //列{ for(int o=0;o<8;o++) { if(xq[o][y]=='*') break; } i 阅读全文
posted @ 2009-06-26 15:56
CMuYu
阅读(178)
评论(0)
推荐(0)

浙公网安备 33010602011771号