摘要:
示例代码: #include <stdio.h> int main(void){ int t = 0 , h = 0 , m = 0 , s = 0 ; scanf("%d",&t); h = t/3600 ; m = t%3600/60; s = t%3600%60; printf("%d:%d: 阅读全文
摘要:
示例代码: #include <stdio.h>#include <stdlib.h> int main(void){ int n = 0 ; int i = 0 , j = 0 , min = 0; int *num ; scanf("%d",&n); num = (int*)malloc(siz 阅读全文
摘要:
总结: 1.使用库函数可有效节省空间,但时间花费较多; 2.由于本题的输入数据较大,又限制时间,故要注意利用空间换时间; 3.使用顺序结构换取最小运行时间; 示例代码: #include <stdio.h>#include <string.h>#define N1 100000 /*16进制*/#d 阅读全文
摘要:
注意事项: 1.长数据注意选择long long类型,用%ldd输出,防止数据溢出; 示例代码: #include <stdio.h>#include <string.h>#include <math.h>#define N 16 int main(void){ char c = 0; char a 阅读全文
摘要:
示例代码: #include <stdio.h>#define N 16 void dg(int a){ int y = a%N; int next = (a-y)/N; if (next) { dg(next); } if (y>9) { printf("%c",65+y%10); } else 阅读全文
摘要:
示例代码: #include <stdio.h> int main(void){ int n = 0 ; scanf("%d",&n); int i = 0 ; int a = 0 , b = 0 , c = 0 , d = 0 , e = 0 , f = 0; for (i = 10000 ; i 阅读全文
摘要:
示例代码: #include <stdio.h> int main(void){ int i = 0 ; int a = 0 , b = 0 , c = 0 , d = 0 ; for (i = 1000 ; i < 10000 ; i ++) { a = i/1000; b = i/100%10; 阅读全文
摘要:
代码示例: #include <stdio.h>#define B(X) (X)*(X)*(X) int main(void){ int i = 0 ; int a = 0 , b = 0 , c = 0 ; for (i = 100 ; i < 1000 ; i ++) { a = i/100; 阅读全文
摘要:
示例代码: #include <stdio.h>#include <stdlib.h> int main(void){ int n = 0 ; int i = 0 , j = 0 ; int *num; scanf("%d",&n); num = (int *)malloc(sizeof(int)* 阅读全文
摘要:
示例代码: #include <stdio.h>#include <stdlib.h> int main(void){ int n = 0 , key = 0 , count = -1; int i = 0 ; int *num; scanf("%d",&n); num = (int *)mallo 阅读全文