- 博客(3)
- 收藏
- 关注
原创 编写函数atof()
编写函数atof(char s[])和read_line(char str[], int n),将字符串转换为对应数值的小数。测试程序为: #include <stdio.h> #include <ctype.h> #define STR_LEN 20 int read_line(char str[], int n); //n为字符串的长度,返回实际读入的字符个数 double atof(char s[]); int main() { char str[STR_LEN + 1..
2022-05-26 21:42:20
219
原创 七段显示器显示整数
编写程序,输入一个整数,使用字符模拟七段显示器来输出该数。计算器、电子手表和其它电子设备经常依靠七段显示器进行数值的输出。为了组成数字,这类设备需要“打开”7个显示段中的某些部分,同时“关闭”其它部分: 需要设置一个数组来保存显示0到9数字时需要“打开”和“关闭”的显示段。 #include<stdio.h> #include<string.h> //第L题 #define MAX 10 const char s[10][7] = { {1,1,1
2022-05-26 19:57:27
670
原创 编写函数atoi()
编写函数atoi(char s[])和read_line(char str[], int n),将字符串转换为对应数值的整数测试程序为: #include <stdio.h> #include <ctype.h> #define STR_LEN 20 int read_line(char str[], int n); //n为字符串的长度,返回实际读入的字符个数 int atoi(char s[]); int main() { char str[STR_LEN + 1];...
2022-05-26 19:43:17
305
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人