2023年09月的文章

【C】质数(素数)判断函数 - AI科研 编程 读书笔记 - 小竹の笔记本

【C】质数(素数)判断函数

代码片段 int isPrime(int x){    //一开始让ret=1,默认是素数    int ret = 1;    int i;    if (x==1||x==0){        //0和1不是素数        ret = 0;        return re...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo2年前
024115
【C】if-else if-else和switch-case - AI科研 编程 读书笔记 - 小竹の笔记本

【C】if-else if-else和switch-case

if-else if-else #include<stdio.h> int main() { int type=0; scanf('%d',&type); if (type==1) printf('早'); else if (type==2) printf('中'); else if (type==3) printf('晚'); else...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo2年前
011511
【C】复合赋值和递增递减 - AI科研 编程 读书笔记 - 小竹の笔记本

【C】复合赋值和递增递减

复合赋值 5个算术运算符,+-*/%,可以和赋值运算符“=”结合起来,形成复合赋值运算符“+=”、“-=”、“/=”和“%=” total += 5; total = total + 5; 注意两个运算符中间不要有空格 total += ...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo2年前
01035
【C】时间差计算(表达式:运算符和算子,取余运算) - AI科研 编程 读书笔记 - 小竹の笔记本

【C】时间差计算(表达式:运算符和算子,取余运算)

时间差计算代码 //计算时间差 #include<stdio.h> int main() { int hour1,minute1,hour2,minute2; printf('请输入第一个时间\n'); scanf('%d %d', &hour1,&minute1); printf('请输入...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo2年前
03018