- 博客(10)
- 资源 (2)
- 收藏
- 关注
原创 poj2965
The Pilots Brothers' refrigerator<br />#include "iostream" #include "math.h" using namespace std; unsigned short int flips[16]={0xf888,0xf444,0xf222,0xf111,0x8f88,0x4f44,0x2f22,0x1f11, 0x88f8,0x44f4,0x22f2,0x11f1,0x888f,0x444f,0x222f,0x11
2011-01-10 15:17:00 609
原创 poj1753
Flip Game<br />#include "iostream" using namespace std; unsigned short int flips[16]={0xc800,0xe400,0x7200,0x3100,0x8c80,0x4e40,0x2720,0x1310, 0x08c8,0x04e4,0x0272,0x0131,0x008c,0x004e,0x0027,0x0013}; int min1=16; unsigned short int poww
2011-01-09 13:51:00 2674 1
原创 poj3094
Quicksum<br />#include "iostream" #include "math.h" using namespace std; int main() { char str[256]; memset(str,0,256); cin.getline(str,256); while(!(str[0]=='#'&&str[1]==0)) { int checksum=0; int len=strlen(s
2011-01-03 16:10:00 493
原创 如何读取整行
<br />直接用cin或者scinf读取字符串,回自动隔断空格和回车,例如要读取“Hello World”就只能按“Hello”和“World”两个串读取。<br />此时需要使用cin.getline()函数,使用实例如下:<br />#include "iostream" using namespace std; int main() { char m[20]; cin.getline(m,5); cout<<m<<endl; return 0; } <br />输入:abcdefg
2011-01-03 15:52:00 615
原创 poj2255
Tree Recovery<br />#include "iostream" #include "math.h" using namespace std; #define Max 27 void left_inorder(char* str1,char *str2,char *res_l,char *res_r); void left_pre(char* str1,char *str2,char *res,char *res2) { char left[Max]; cha
2011-01-03 12:57:00 751
转载 ACM中无输入结束提示时如何判断到达EOF
1.while((scanf"%d,%d",&m,&n)==2) { //... }2.while((scanf"%d,%d",&m,&n)!=EOF) { //... }3.while(cin>>m>>n) { //... }原帖地址:http://blog.csdn.net/super_chris/archive/2009/08/29/4495919.aspx
2011-01-03 12:46:00 682
原创 poj3006
Dirichlet's Theorem on Arithmetic Progressions<br />#include "iostream" #include "math.h" using namespace std; bool isPrime(int x); int main(int argc, _TCHAR* argv[]) { int a,d,n; cin>>a; cin>>d; cin>>n; while(a!=0||d!=0||n!=0
2011-01-02 20:28:00 685
原创 poj1503
Integer Inquiry<br />#include "iostream" #include "math.h" using namespace std; bool isEnd(char *str) { if(str[0]=='0'&&str[1]==0)return true; else return false; } void add(char *num1,char *num2); void move(char *num); int main() {
2011-01-02 00:02:00 431
原创 poj3299
Humidex<br />#include "iostream" #include "math.h" using namespace std; void formula(double& t,double& d,double& h); int main(int argc, _TCHAR* argv[]) { char cmd; cin>>cmd; while(cmd!='E') { double t=200,d=200,h=200;
2011-01-01 20:06:00 738
原创 poj2159
Ancient Cipher#include "iostream" #include "math.h" using namespace std; int compare(int *str1,int *str2); int main(int argc, _TCHAR* argv[]) { char old[101]; int s1[26]; int s2[26]; for(int j=0;j<26;j++) { s1[j]=0;
2011-01-01 20:04:00 477
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人