03 2013 档案

摘要:#includeusing namespace std;struct stu{char name[12];struct stu *next;};int main(){struct stu *head,*p;head=new stu;cin>>head->name;p=head->next=new stu;cin>>p->name;p->next=NULL;coutnamename<<endl;return 0;} 阅读全文
posted @ 2013-03-09 00:16 _一千零一夜 阅读(73) 评论(0) 推荐(0)
摘要:#include using namespace std;struct Date { int year; int month; int day; }; int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};int main() { Date date; cout>date.year>>date.month>>date.day; int days=0,i; for(i=1;i=3) days+=1; //闰年的2月要加1天 cout<<date.month<<"月"<&l 阅读全文
posted @ 2013-03-07 22:16 _一千零一夜 阅读(102) 评论(0) 推荐(0)
摘要:#include using namespace std; struct Student { char num[13]; char name[10]; int cpp; int math; int english; int grade; double average; }; const int N=3; int main( ) { int i; Student stu[5]; for(i=0;i>stu[i].num; cin>>stu[i].name; cin>>stu[i].cpp; cin>>stu[i].math; cin>>stu 阅读全文
posted @ 2013-03-07 22:12 _一千零一夜 阅读(131) 评论(0) 推荐(0)
摘要:#includeusing namespace std;void chengji(const float s[5][3] );int main( ) { float s[5][3]; int i,j; for (i=0;i>s[i][j]; chengji(s); return 0; } void chengji(const float s[5][3]) { int i,j; float sum=0; for(i=0;i<5;i++){for(j=0;j<3;j++) sum=sum+s[i][j]; cout<<"第"<<i+1& 阅读全文
posted @ 2013-03-06 23:25 _一千零一夜 阅读(80) 评论(0) 推荐(0)
摘要:#includeusing namespace std;long fac(int n);int main () { int n; cout>n ; cout<<fac(n)<<endl; return 0; } long fac(int n) {if(n==1) return n;else return (2*n-1)*fac(n-1); } 阅读全文
posted @ 2013-03-06 23:07 _一千零一夜 阅读(106) 评论(0) 推荐(0)
摘要:#includeusing namespace std;char * stringcat(char *source, const char *dest);int main() { char s1[30]="I love "; char *s2="C++"; stringcat(s1,s2); cout<<s1<<endl; return 0; } char * stringcat(char *source, const char *dest) { char *p=source;for(int i=0;i<7;i++) sou 阅读全文
posted @ 2013-03-06 22:48 _一千零一夜 阅读(105) 评论(0) 推荐(0)
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long llint; typedef pair par; #define x first #define y second class StringG... 阅读全文
posted @ 2013-03-05 21:32 _一千零一夜 阅读(317) 评论(0) 推荐(0)