摘要:
//有n盏灯,编号为1 ~ n ,第一个人把所有的等都打开,第二个人按下所有编号为2的倍数(这些灯将关掉),第三个人按下所有编号为3的倍数的开关(//其中关掉的灯将打开,开着的灯将关掉),以此类推,一共有k个人,问最后哪些灯开着?//输入:n和k,输出开着的灯的编号。k #include #defi... 阅读全文
posted @ 2015-04-24 20:43
Tsl_Dream
阅读(258)
评论(0)
推荐(0)
摘要:
//输入一个字符串,求出其中最长的回文子串。子串的含义是:在原串中连续出现的字符片段。回文的含义是:正着看和倒着看相同,如abba和yyxyy。//在判断时,应该忽略所有的标点和空格,且忽略大小写,但输出应该保留原样(在回文串的首部和尾部不要输出多余字符)。输出字符串长度不超//过5000,且占据单... 阅读全文
posted @ 2015-04-24 20:42
Tsl_Dream
阅读(301)
评论(0)
推荐(0)
摘要:
#include char del(char s[],int pos,int len){ int i; for(i = pos+len-1; s[i] != '\0'; i ++, pos ++) { s[pos - 1] = s[i]; } s[pos ... 阅读全文
posted @ 2015-04-24 20:22
Tsl_Dream
阅读(347)
评论(0)
推荐(0)
摘要:
#include #include #include #define MAX 2//车库容量#define price 0.05//每车每分钟费用typedef struct time//时间结点{ int hour; int min;}Time;typedef struct node{... 阅读全文
posted @ 2015-04-24 20:18
Tsl_Dream
阅读(4522)
评论(0)
推荐(0)
摘要:
#include #include #include typedef struct student{ int id; char name[20]; int age; char sex; char birthday[20]; char address[20]; ... 阅读全文
posted @ 2015-04-24 20:15
Tsl_Dream
阅读(15512)
评论(0)
推荐(0)
浙公网安备 33010602011771号