Catherine_zhilin

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2019年7月4日

摘要: 1 #include <stdio.h> 2 3 int main(){ 4 char str[15]={'G','o','o','d',' ','s','t','o','r','y','!'}; 5 int i; 6 for(i=0;i<11;i++){ 7 printf("%c",str[i]) 阅读全文
posted @ 2019-07-04 22:01 kkkshiki 阅读(134) 评论(0) 推荐(0)

摘要: int a[5][6]; doube db[10][10]; char [256][256]; bool vis[1000][1000]; 1 #include <stdio.h> 2 3 int main(){ 4 int a[5][6]={{3,1,2},{8,4},{},{1,2,3,4,5} 阅读全文
posted @ 2019-07-04 15:18 kkkshiki 阅读(376) 评论(0) 推荐(0)

摘要: 交换两个数的基本逻辑 1 #include <stdio.h> 2 3 int main(){ 4 int a[10]={3,1,4,5,2}; 5 int i,j,k; 6 for(i=1;i<=4;i++) {//进行n-1次比较 7 //从i趟时从a[0]到a[n-i-1]都与他们下一个数比较 阅读全文
posted @ 2019-07-04 15:16 kkkshiki 阅读(355) 评论(0) 推荐(0)

摘要: 数组 1 #include <stdio.h> 2 3 int main(){ 4 int a[10]={5,3,2,6,8,4}; 5 int i; 6 for(i=0;i<10;i++){ 7 printf("a[%d]=%d\n",i,a[i]); 8 9 } 10 return 0; 11 阅读全文
posted @ 2019-07-04 14:59 kkkshiki 阅读(142) 评论(0) 推荐(0)

摘要: 常用math函数 1 #include <stdio.h> 2 #include <math.h> 3 4 /*绝对值*/ 5 int main(){ 6 double db=-12.56; 7 printf("%.2f\n",fabs(db)); 8 return 0; 9 } 1 #includ 阅读全文
posted @ 2019-07-04 11:35 kkkshiki 阅读(168) 评论(0) 推荐(0)

摘要: 1 #include <stdio.h> 2 3 4 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 5 /*输出数据1 换行2 输出数据2 ;计 阅读全文
posted @ 2019-07-04 11:03 kkkshiki 阅读(209) 评论(0) 推荐(0)

摘要: C C++比较: 1. Scanf printf 函数 Cin cout可不指定输入输出格式,消耗时间多 2. Stdio :standard input output .h——head Stdio.h ——include sth about input and output (cstdio) #i 阅读全文
posted @ 2019-07-04 08:41 kkkshiki 阅读(91) 评论(0) 推荐(0)