摘要: 第五章可以参照C语言第5章 阅读全文
posted @ 2020-05-12 23:07 nightswatch-candle 阅读(226) 评论(0) 推荐(0)
摘要: 练习4-1 // 判断读入的整数值的符号(正/负/0)并显示判断结果 import java.util.Scanner; class New { public static void main(String[] args) { Scanner stdIn = new Scanner(System.i 阅读全文
posted @ 2020-05-12 18:49 nightswatch-candle 阅读(495) 评论(0) 推荐(1)
摘要: 练习3-1 package candle1220; import java.util.Scanner; public class Nightwatch { public static void main(String[] args){ Scanner stdIn=new Scanner(System 阅读全文
posted @ 2020-05-11 22:10 nightswatch-candle 阅读(440) 评论(0) 推荐(1)
摘要: 练习4-1 /* 珠玑妙算 */ #include <time.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> /* 生成4个不同数字的组合并存入数组x */ void make4dig 阅读全文
posted @ 2019-12-08 14:59 nightswatch-candle 阅读(628) 评论(0) 推荐(0)
摘要: 练习2-1 编译错误,无法运行。 练习2-2 package candle1220; class Nightwatch{ public static void main(String[] args) { int x,y,z; x=22; y=23; z=35; System.out .println 阅读全文
posted @ 2019-12-06 00:09 nightswatch-candle 阅读(619) 评论(2) 推荐(0)
摘要: 练习1-1 无法运行 练习1-2 package candle1220; class Nightwatch{ public static void main(String[] args) { System .out .print("柴\n田\n望\n洋"); } } 练习1-3 package ca 阅读全文
posted @ 2019-12-05 01:17 nightswatch-candle 阅读(322) 评论(0) 推荐(0)
摘要: 练习3-1 /* 猜拳游戏(其四:分割函数/显示成绩)*/ #include <time.h> #include <stdio.h> #include <stdlib.h> int human; /* 玩家的手势 */ int comp; /* 计算机的手势 */ int win_no; /* 胜利 阅读全文
posted @ 2019-12-05 00:44 nightswatch-candle 阅读(508) 评论(0) 推荐(0)
摘要: 练习2-1 /* 倒计时后显示程序运行时间 */ #include <time.h> #include <stdio.h> /* 等待x毫秒 */ int sleep(unsigned long x) { clock_t c1 = clock(), c2; do { if ((c2 = clock( 阅读全文
posted @ 2019-12-04 01:16 nightswatch-candle 阅读(608) 评论(0) 推荐(0)
摘要: 练习1-1 #include <stdio.h> #include<stdlib.h> int main() { srand(time(0)); int anw = rand() % 7; printf("您的签运是:"); switch (anw) { case 0:printf("大吉"); b 阅读全文
posted @ 2019-12-02 22:09 nightswatch-candle 阅读(644) 评论(0) 推荐(1)
摘要: //寻找完全数。 #include <stdio.h> int main() { int i, j; int sum; for (i = 1; i < 1000; i++) { sum = 0; for (j = 1; j < 1000; j++) { if (i % j == 0&&j!=i) { 阅读全文
posted @ 2019-11-30 17:29 nightswatch-candle 阅读(249) 评论(0) 推荐(0)