发现一本基础的shell脚本教程,只有两个小时时候,先粗略的过一遍大体只是,往后慢慢再仔细学习。 4.条件判断 : 【if】 if [];then elif[];then else fi :正确格式: if空[空-r空“a”空];then 【case】 case "string" in *) ... ...
分类:
系统相关 时间:
2016-12-08 21:23:54
阅读次数:
187
1.#include <stdio.h>#if defined(ANDROID20) #pragma message("Compile Android SDK 2.0...") #define VERSION "Android 2.0"#elif defined(ANDROID23) #pragma ...
分类:
其他好文 时间:
2016-12-08 20:25:11
阅读次数:
204
1、当有多个条件是用 elif 这样就不用那么多缩进 score = int(input('输入一个分数'))if 100 >= score >= 85: print('A')elif 85 > score >= 60: print('B')elif 60 > score >= 0: print(' ...
分类:
编程语言 时间:
2016-12-07 20:36:49
阅读次数:
319
if如果条件为真,执行子句中的代码if...else...如果条件为真,执行这段代码;否则,执行那段代码(else语句不包含条件)elif否则如果while循环break跳出循环continue跳回到循环开始处break语句将执行移出循环,接着循环之后执行continue语句将执行移到循环的开始foriinrange(1,..
分类:
编程语言 时间:
2016-12-06 23:30:06
阅读次数:
342
预处理器命令的功能非常强大,在编程过程中的使用也非常广泛,比如在版本发布中使用非常方便;1,#define(告诉编译器存在给定名称的符号) #undefine(删除符号)2,#if #elif #else #endif#define本身没有什么作用,一般与其他预处理器指令配合使用(#if)使用#de... ...
选择语句 if 条件判断 : # 条件可以加括号也可以不加括号 …… else: …… Python中没有switch语句这是可以使用if exp:.... elif exp:来代替 Python 循环语句 循环控制语句可以更改语句执行的顺序。Python支持以下循环控制语句: 循环使用 else ...
分类:
编程语言 时间:
2016-12-02 21:58:08
阅读次数:
649
linux编写猜数字游戏:#!/bin/bash
n=1
while[$n-le3]
do
a=`expr$RANDOM%10`
b=0
echo"caijiagedi$nlun"
while[$b-le4]
do
read-p"shurujiage:"c
letb++
if[$c-eq$a]
then
echo"caiduile"
echo"caile$bci"
break
elif[$c-lt$a]
then
echo"dile"
else
echo"gaole"
fi
done
if[$..
分类:
其他好文 时间:
2016-12-02 03:46:31
阅读次数:
166
1 def GCU(m, n): 2 if not m: 3 return n 4 elif not n: 5 return m 6 elif m is n: 7 return m 8 9 if m > n: 10 gcd = n 11 else: 12 gcd = m 13 14 while m% ...
分类:
编程语言 时间:
2016-11-30 03:04:22
阅读次数:
214
专题三: 1) 预编译 处理所有的注释,以空格代替, 将所有的#define删除,并且展开所有的宏定义, 处理条件编译指令#if,#ifdef,#elif,#else,#endif 处理#include,展开呗包含的文件, 保留编译器需要使用的#pragma指令, 预处理指令:gcc-E file. ...
分类:
编程语言 时间:
2016-11-28 08:07:38
阅读次数:
289
主要以后我以后使用Python3. 变量 写好存数据,可以以后调用. 看下面代码. 用户输入 if else 判断语句: getpass for 循环 int使用 加elif else一起用: 字符编码 ***pass用法:在代码前面加上pass的话,不让这行代码执行,让这个程序继续成立,也不影响其 ...
分类:
其他好文 时间:
2016-11-26 17:29:34
阅读次数:
128