摘要: 1 #include <iostream> 2 #include <vector> 3 #include <algorithm> 4 5 using namespace std; 6 7 class EllysCoprimesDiv2{ 8 public: 9 int gcd(int x,int y){10 while(x){11 int r = x;12 x = y%x;13 y=r;14 }15 return y;16 }17 int get... 阅读全文
posted @ 2013-04-28 21:31 OpenSoucre 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 很郁闷的一题,一定要认真读题目,特别注意这句话 Concatenate its elements to obtain one long string,,,一定要理解这句话 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <algorithm> 5 #include <sstream> 6 #include <numeric> 7 using namespace std; 8 9 class EllysRoomAssignmen 阅读全文
posted @ 2013-04-28 21:05 OpenSoucre 阅读(190) 评论(0) 推荐(0) 编辑
摘要: // accumulate example#include <iostream>#include <functional>#include <numeric>using namespace std;int myfunction (int x, int y) {return x+2*y;}struct myclass { int operator()(int x, int y) {return x+3*y;}} myobject;int main () { int init = 100; int numbers[] = {10,20,30}; cout < 阅读全文
posted @ 2013-04-28 19:31 OpenSoucre 阅读(399) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <vector>#include <string>using namespace std;const string vowels = "aeiouy";bool isVowels(char ch){ for(int i = 0; i < vowels.length(); i ++ ) if( vowels[i] == ch) return true; return false;}class EllysNewNickname{public: int getLength(strin 阅读全文
posted @ 2013-04-28 19:00 OpenSoucre 阅读(145) 评论(0) 推荐(0) 编辑