自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 收藏
  • 关注

原创 容易——字符数组——输入字符串,包含:字母、数字、标点符号,以及空格字符,并将其逆序输出。

输入字符串,包含:字母、数字、标点符号,以及空格字符,并将其逆序输出。 例如,当输入字符串为“I am a student.”,输出为“.tneduts a ma I”,假设字符数组最大长度为30。 输入提示信息:“Please Enter String1:\n” 输入格式:gets() 输出格式:“Result is:\n%s\n” 程序运行结果示例: Please Enter String1: I am a student.↙ Result is: .tneduts a ma I #incl ude &

2021-06-08 22:56:41 1475

原创 容易——字符数组——字符串转换成整数

输入一个以回车结束的字符串(少于10个字符),它由数字字符组成,将该字符串转换成整数后输出。注意,不能直接调用库函数atoi完成。 **输入提示信息:"Enter a string: " **输出格式要求:“digit = %d\n” 程序运行示例如下: Enter a string: 123 digit = 123 #include<stdio.h> int main() { int i=0, n=0; char a[10]; printf("Enter a stri

2021-06-08 22:52:49 719

原创 容易——字符数组——找出字符串中最大字符元素

编程实现找出字符串中最大字符元素并输出该元素及其对应的ASCII值. ****要求输入提示信息为: “Input a string:\n” ****输出格式要求为: “The largest character of “%s” is ‘%c’ ,The ASCII is %d.” 程序运行示例: Input a string:↙ I am a student. The largest character of “I am a student.” is ‘u’ ,The ASCII is 117.↙ #inc

2021-06-07 21:15:19 3284

原创 容易——字符数组——改错——统计英文字符、数字字符、空格字符,以及其他字符的个数

输入一行字符,统计其中的英文字符、数字字符、空格字符,以及其他字符的个数。请找出以下程序的错误,并改正之。 #include <stdio.h> #include <string.h> #define ARR_SIZE 80 int main() { char str[ARR_SIZE]; int len, i; int letter=0,digit=0,space=0,other=0; printf("请输入一个字符串:"); ge

2021-06-07 21:04:34 358

原创 容易——字符数组——回文判断

有趣的“回文”检测 英文中有很多的回文词,回文词的拼法十分有趣,无论是从前往后拼读,还是从后往前拼读,他们的拼法和词义都不变。例如:dad(爸爸),mum(妈妈),noon(中午),eve(前夕),eye(眼睛),pop(流行),deed(行为),level(水平)等。简单地说,“回文”就是指顺读和倒读都一样的字符串。现在请你编程输入一个单词,判断它是否是回文。 #include<stdio.h> #include<string.h> int main() { char a

2021-06-07 21:00:54 746

原创 容易——字符数组——字符串逆序

输入一个字符串,将其逆序输出。 输入提示信息:“Please Enter String1:\n” 输入字符串用gets() 输出提示信息和输出格式:“Result is:\n%s\n” 程序运行示例: Please Enter String1: hello world!↙ Result is: !dlrow olleh #include <stdio.h> #include <string.h> int main(void) { int len, i; char s

2021-06-07 20:54:08 194

原创 容易——字符数组——统计英文字符、数字字符、空格和其他字符的个数

输入一行字符,统计其中的英文字符、数字字符、空格和其他字符的个数。 输入提示信息:“Please input a string:” 输入字符串用gets() 输出提示信息和格式: “English character: %d\n” “digit character: %d\n” “space: %d\n” “other character: %d\n” 程序运行示例: Please input a string:dytxx246$6@,. English character: 5 digit

2021-06-07 20:50:11 720

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除