原创 POJ 2183

Description Farmer John loves to help the cows further their mathematical skills. He has promised them Hay-flavore

原创 CodeForces 415B

Description Bimokh is Mashmokh's boss. For the following n days he decided to pay to his workers in a new way. At t

原创 HDU—2571 命運

Wa了10次。。。 AC代碼: #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int nas

原创 100 - The 3n + 1 problem

這道題要注意的一個問題是:當輸入的第一個數大於第二個數時,在計算時,應該把兩個數置換一下。輸出時,無論兩個數的大小關係如何,保持和輸入時一樣。 #include<iostream> #include<cstdio> #include<cs

原创 CodeForces 401C

Description Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming O

原创 《征服C指針》第一章重點小結

1:指針也是有指針類型的,但是它是由其他的類型派生出來的類型。它的定義中有這樣的一段話:由引用類型T派生的指針類型有時稱爲“指向T的指針”。也就是說:實際上存在的是“指向int的指針類型”、“指向double的指針類型”等等。 2:根據引

原创 《C程序設計語言——第二版》第一章知識點總結

1:字符序列在C語言中稱爲:字符串或字符串常量(PS:之前總以爲它們兩個指的是不同的東西!) 2:在C語言中,字符序列\n表示換行符,在打印中遇到它時,輸出打印將換行,從下一行的左端行首開始。如果去掉字符串中的\n,即使輸出打印完成後也不

原创 Codeforces 131_A

這道題的情況有四種:1)如果是單個字符:大寫字母輸出小寫形式;小寫字母輸出大寫形式。2)如果只有第一個字符是小寫,其餘的字符都是大寫:第一個字符輸出大寫形式,其餘字符輸出小寫形式。3)如果全都是大寫:所有字符小寫形式輸出。4)如果不在上述

原创 CodeForces 405A

Description Little Chris is bored during his physics lessons (too easy), so he has built a toy box to keep himself

原创 B - Catch That Cow

這道題是在前輩的幫助下做完的! 提交的時候出現了兩種情況: 1:超時 原因:用While()循環輸入的時候沒有加結束輸入的東西 超時代碼: while(scanf("%d%d",&m,&n)) 加了!= EOF 的代碼: while

原创 POJ-1163

這道題和HDU-2084很像。 #include<iostream> #include<cstdio> #include<cstring> using namespace std; int nasce,n,max_two; int nu

原创 HDU-2084 數塔

#include<iostream> #include<cstdio> #include<cstring> using namespace std; int nasce,n,max_two; int number[101][101]; v