2016年10月22日
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 class Rational 7 { 8 public: 9 Rational(); 10 Rational(long numerator, long denominator); 11 long getNumerator()... 阅读全文
posted @ 2016-10-22 14:04 任我主宰 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 int main() 6 { 7 int t; 8 cin>>t; 9 int a = t; 10 getchar(); 11 while(t--){ 12 string s; 13 int n; 14 cin>>n; 15 getcha... 阅读全文
posted @ 2016-10-22 13:55 任我主宰 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 class player{ 7 public: 8 char manplay(int a); 9 char computerplay(int a); 10 int a; 11 char s[3][3]... 阅读全文
posted @ 2016-10-22 13:55 任我主宰 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 int main(){ 4 long long a,b; 5 long long d,e; 6 while(cin>>a>>b){ 7 d=a;e=b; 8 int c; 9 if(a<b){ 10 long long t; 11 t=a; 12 a=b; 13 b... 阅读全文
posted @ 2016-10-22 13:54 任我主宰 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 template 6 class Array 7 { 8 public: 9 Array(); 10 ~Array(); 11 bool empty(); 12 void push... 阅读全文
posted @ 2016-10-22 13:52 任我主宰 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 int main() 5 { 6 string x, y, z; 7 cin >> x >> y >> z; 8 9 ifstream file1(x.c_str()); 10 ifstream file2(y.c_str()); 11 ofstream file3(... 阅读全文
posted @ 2016-10-22 13:52 任我主宰 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 class Bank 5 { 6 public: 7 Bank(string _name) 8 { 9 name = _name; 10 } 11 string getName() const 12 { 13 return name; 14... 阅读全文
posted @ 2016-10-22 13:51 任我主宰 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 /* 4 usingnamespacestd; 5 6 structNode 7 { 8 int data;//数据域 9 struct Node*next;//指针域 10 }; 11 12 /* 13 Create 14 *函数功能:创建链表. 15 *输入:各节点的data ... 阅读全文
posted @ 2016-10-22 13:50 任我主宰 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 int main(){ 5 int n; 6 cin>>n; 7 while(n--){ 8 int t; 9 cin>>t; 10 int points=0; 11 while(t--){ 12 int a,b; 13 cin>>a>>b; 14 ... 阅读全文
posted @ 2016-10-22 13:49 任我主宰 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 int main() 5 { 6 int n; 7 cin>>n; 8 if(n==1) { 9 cout<<2<<endl; 10 return 0; 11 } 12 n=n-1; 13 int t=3; 14 while... 阅读全文
posted @ 2016-10-22 13:48 任我主宰 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 int main(){ 5 int a,b,c; 6 cin>>a>>b>>c; 7 long long sum=1; 8 for(int i=1;i<=b;i++){ 9 sum = sum*a%c; 10 } 11 cout<<sum%c<<endl; 12 re... 阅读全文
posted @ 2016-10-22 13:47 任我主宰 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 int main() 4 { 5 int i,j; 6 cin>>i>>j; 7 int max=0; 8 for(int t=i;tmax) max=len; 22 } 23 cout<<max<<endl; 24 return 0; 25 } 阅读全文
posted @ 2016-10-22 13:46 任我主宰 阅读(247) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;int main(){ int n; while(cin>>n&&n!=0&&n<=4){ int t; int max=0; for(int i=0;i<n;i++){ cin>>t; if(t>max) max=t; } 阅读全文
posted @ 2016-10-22 13:45 任我主宰 阅读(161) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;int main(){ struct student{ string studentname; int qimograde; int banjigrade; char xuesgb; char xibxs; int lunw 阅读全文
posted @ 2016-10-22 13:44 任我主宰 阅读(139) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;int main(){ int ts; cin>>ts; for(int i=0;i<ts-1;i++){ int n,a,b; while(cin>>n){ int sum = 0; while(n--){ int t; 阅读全文
posted @ 2016-10-22 13:43 任我主宰 阅读(148) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;int root(int s){ if(s<10){ return s; } else{ int a=s; int b=0; while(a!=0){ b+=a%10; a=a/10; } root(b); }}int ma 阅读全文
posted @ 2016-10-22 13:42 任我主宰 阅读(88) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;int main(){ int n; while(cin>>n&&n!=0){ int t; int t0=0; int sum=0; while(n--){ cin>>t; if(t>t0) sum += (t-t0)*6 阅读全文
posted @ 2016-10-22 13:41 任我主宰 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<iomanip>#include<set>#include<vector>#include<algorithm>using namespace std;class SetOperation { public: // Add any codes y 阅读全文
posted @ 2016-10-22 13:40 任我主宰 阅读(154) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<string>#include<cstring>using namespace std;class String { public: String(); // str = "" String(const char*); // str = "abc 阅读全文
posted @ 2016-10-22 13:38 任我主宰 阅读(177) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <vector>#include <algorithm>using namespace std; class Student{ public: Student(string _name, int _score) { name = _name; 阅读全文
posted @ 2016-10-22 13:37 任我主宰 阅读(155) 评论(0) 推荐(0) 编辑