求闰年

摘要: #include<iostream>using namespace std;int main(){int year;bool leap;cout <<"please enter yeat:";cin >>year;if(year % 4 != 0)leap = false;else if(year % 100 != 0)leap = false;else if(year % 400 != 0)leap = false;else leap = true;if(leap)cout <<year << " is 阅读全文
posted @ 2013-06-05 11:24 张明online 阅读(122) 评论(1) 推荐(0)

2013年博客的第一次随笔,算加权平均分

摘要: #include <iostream>#include <string>using namespace std;class Student{public: string name;double score[2][3];//假设有2学期三课成绩;double average1;double average2;void Set_avrage(int i);//求加权平均分void Input(int i);};int main(){Student s[3];int i,j;cout<<"请依次输入3个学生的名字:"<<endl;f 阅读全文
posted @ 2013-06-05 10:36 张明online 阅读(125) 评论(3) 推荐(0)