From CS50
来源:互联网 发布:最新金融网络投资 编辑:程序博客网 时间:2024/05/22 08:21
Week 0
//Hello World!#include<stdio.h>int main(){printf("Hello,World!\n");return 0;}
Week 1
#include<stdio.h>#include<unistd.h>int main(){for(int i=0;i<=10;i++)//c99标准准许在for内声明变量{printf("update %3d%%\r",i);//"\r"用来回到行首,实现只更新数字的效果fflush(stdout);//立即显示缓冲区中的内容(实时效果)sleep(1);//from "unistd.h"}printf("complete\n");return 0;}
Week 2
//计算机的精度有限#include<stdio.h>int main(){float x = 0.88;float y = 0.01;float z = x + y;printf("%f\n",z);printf("%.10f\n",z);return 0;}
//字符其实也是数字#include<stdio.h>int main(){char c;for(c = 'A'; c <= 'Z'; c++)printf("%c: %d\n",c,c);return 0;}
//stack:逐个调用再返回,increment里x++的x是local variable#include<stdio.h>int x;void increment();int main(){printf("x:%d\n",x);printf("x is increasing\n");increment();printf("x:%d\n",x);}void increment(){int x = 10;x++;}
0 0
- From CS50
- CS50笔记
- 【CS50】写在学习前
- CS50 任务1 笔记
- CS50 任务2 笔记
- CS50 任务3 笔记
- CS50 任务4 笔记
- cs50-week1-Short-comilers
- CS50 2016 Week 11
- CS50 2017 Lecture 0
- CS50 2017 Week1
- Harvard cs50翻译计划
- CS50 2016-Week3 学习笔记
- CS50 2016-Week4 学习笔记
- CS50 2013-Week5 学习笔记
- CS50 2016 Week9 学习笔记
- CS50 2016 Week10 学习笔记
- 写点看Harvard CS50 公开课的感受
- 黑马程序员——05C语言语法和mac基本快捷键使用
- 复习一下快忘记了的进制转换
- [NFC]简单介绍
- [一起学Node.js][001话] Express MongoDB搭建多人博客
- volatile
- From CS50
- python3 以utf-8编码写文件
- hdu2294---Pendant (矩阵)
- 基于netty的心跳检测
- 奥迪QW7 打开V货到付款V的风景
- Chapter3 Growth of Functions
- 希尔排序
- PureWhite OpenCart 商城自适应主题模板 ABC-0009
- 小赵学习Opencv(3)之高效图像遍历循环