01 2021 档案

摘要:样例输入 I am a student 样例输出 student 1 #include <stdio.h> 2 #include <string.h> 3 int main() 4 { 5 char a[100005], b[100005]; 6 int i, num = 0; 7 while (s 阅读全文
posted @ 2021-01-28 20:31 荣荣荣荣荣荣 阅读(103) 评论(0) 推荐(0)
摘要:题目描述 小朋友排成一排,老师给他们分苹果。小朋友从左到右标号1..N。有M个老师,每次第i个老师会给第Li个到第Ri个,一共Ri-Li+1个小朋友每人发Ci个苹果。最后老师想知道每个小朋友有多少苹果。 输入 第一行两个整数N、M,表示小朋友个数和老师个数。 接下来M行,每行三个整数Li、Ri、Ci 阅读全文
posted @ 2021-01-27 18:52 荣荣荣荣荣荣 阅读(94) 评论(0) 推荐(0)
摘要:样例输入 one little two little three little boys 样例输出 5学会将一个字符串分为多个字符串比较。 1 #include <stdio.h> 2 #include <string.h> 3 4 char a[10100]; 5 int f(){ 6 int i 阅读全文
posted @ 2021-01-27 14:48 荣荣荣荣荣荣 阅读(101) 评论(0) 推荐(0)
摘要:字符串操作: gets函数: gets(str); puts函数: puts(str); strcat函数 字符串连接函数 char str1[30] = {"apple"}; char str2[30] = {"app"}; printf("%s",strcat(str1,str2));输出: a 阅读全文
posted @ 2021-01-19 14:27 荣荣荣荣荣荣 阅读(63) 评论(0) 推荐(0)