smallc04 / c-language Goto Github PK
View Code? Open in Web Editor NEW一个计算机小萌新的成长之路
一个计算机小萌新的成长之路
第二章--判断与循环
if( total > amount ){ total += amount + 10 ; }
int type; switch(type){ case(type1): (当type == type1时,执行该case栈下的语句) 执行语句1; break; case(type2): 执行语句2; break; ... ... default: (当type != 任何type n 的值时,执行default栈下的语句) 执行语句; }
9.循环
循环共有三种: while 循环 ; do - while 循环 ; for循环
while循环:
使用范围较广
while (条件表达式){
循环体;
判断变量变化;
}
do - while循环:
先执行一次,在判断要不要继续执行
通常用于必须执行一次的循环
do{
循环体;
}
while(条件表达式);
for 循环 :
for循环就像一个计数循环: 设定一个计数器, 初始化他, 然后在计数器达到某值之间, 重复执行循环体, 而每执行一轮循环, 计数器值以一定步长进行调整
for循环通常用于有着固定循环次数的循环
int i
for(i初始化,条件判断, i++):
循环体;
小技巧: 求和时初始化设为0, 求积时初始化设为1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.