算法
qq_25221123
这个作者很懒,什么都没留下…
展开
-
LeetCode|Reverse Words in a String
题目: Given an input string ,reverse the string word by word .For example , Given s=”the sky is blue ‘, return “blue is sky the “. 思路: 方法1:首先把句子看成由词组成的,例如,A B C ,因此可以将句子的所有字符前后交换,得到 C B A,显然X表示逆序的词转载 2018-01-03 23:28:32 · 127 阅读 · 0 评论 -
编程马拉松 算法题
/ write your code here cpp#includeusingnamespace std;int LCM(int num1,int num2){ int x,y; if(num1 num1^=num2;num2^=num1;num1^=num2; } x=num1;y=num2;原创 2018-01-15 16:11:55 · 527 阅读 · 0 评论 -
算法题------分遗产
//代码注释#includeusing namespacestd;int LCM(int num1,int num2){ int x,y; if(num1 num1^=num2;num2^=num1;num1^=num2; } x=num1;y=num2; while(y!=0) {int temp=x原创 2018-01-15 17:03:29 · 645 阅读 · 0 评论 -
包含1
#include using namspece std;const int INF=1具体代码在GitHub上存原创 2018-01-15 17:51:42 · 256 阅读 · 0 评论 -
编程马拉松刷题
循环数字:代码见原创 2018-01-16 15:14:21 · 366 阅读 · 0 评论 -
编程强势糖果
#include #include using namespace std;int main(){string nowcoder,brother;while (cin>>nowcoder>>brother){if(nowcoder.length() { cout return 0; } int hashTable [26]={0}; fo原创 2018-01-16 16:44:11 · 249 阅读 · 0 评论 -
马拉松 算法 做卷子那道题
#include #include #include #incldue using namespace std;//做卷子 //家庭作业 struct Homework{ int num; int value; double average; bool operator { return (average }};int main(原创 2018-01-16 17:09:45 · 225 阅读 · 0 评论 -
算法 发工资
//人家用向量做的,我就暴力破解吧//发工资不用找零 #include using namespace std;int judge(int money){ int sum_100=0; int sum_50=0; int sum_20=0; int sum_10=0; int sum_5=0; int sum_2=0; int sum_1=0;//初原创 2018-01-16 17:43:16 · 559 阅读 · 0 评论 -
LeetCode 刷题
题目:T he gray code is binary numeral system where two successive values differ in only one bit.Given a non-negative interger n representing the total number of bits in the code,print the sequence o原创 2018-01-17 11:09:20 · 129 阅读 · 0 评论