2024.1.14

今天英语考试了,我复习了很久(也就每天晚上看一个多小时),但我是万万没有想到啊,居然这么简单,感觉就听力和作文像大学题,其他和初中题差不多,这下有经验了,下次考试不复习这么久了,还是看看今天的代码吧。

cpp 复制代码
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
//struct stu
//{
//	char name[20];
//	char num[12];
//	char sex[5];
//	char number[55];
//};
//int main()
//{
//	struct stu s1 = { "张三","123456","男","165444" };
//	printf("%s %s %s %s", s1.name, s1.num, s1.sex, s1.number);
//	return 0;
//}
//#define _CRT_SECURE_NO_WARNINGS
//#include<stdio.h>
//int main()
//{
//	printf("size of it?\n");
//	int sz;
//	scanf("%d", &sz);
//	int i, j;
//	for (i = 1; i <= sz; i++)
//	{
//		for (j = 1; j <= i; j++)
//		{
//			printf("%2d *%2d=%2d ", i, j, i * j);
//		}
//		printf("\n");
//	}
//	return 0;
//}
//#define _CRT_SECURE_NO_WARNINGS
//#include<stdio.h>
//int check(int year)
//{
//	if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
//	{
//		return 1;
//	}
//	else
//		return 0;
//}
//int main()
//{
//	int year;
//	scanf("%d", &year);
//	int ret = check(year);
//	if (ret == 1)
//		printf("yes\n");
//	else
//		printf("no\n");
//	return 0;
//}
//#define _CRT_SECURE_NO_WARNINGS
//#include<stdio.h>
//#include<math.h>
//int count = 0;
//int is_prime(int i)
//{
//	int k = sqrt(i);
//	int j = 1;
//	for (j = 2; j <= k; j++)
//	{
//		if (i % j == 0)
//			return 0;
//	}
//	count++;
//	return 1;
//}
//int main()
//{
//	int i = 101;
//	for (i = 101; i <= 200; i += 2)
//	{
//		if (is_prime(i))
//		{
//			printf("%d ", i);
//		}
//	}
//	printf("\n");
//	printf("count = %d", count);
//	return 0;
//}
//#define _CRT_SECURE_NO_WARNINGS
//#include<stdio.h>
//void init(int* arr, int n)
//{
//	int i;
//	for (i = 0; i < n; i++)
//	{
//		scanf("%d", &arr[i]);
//	}
//}
//void my_printf(int* arr, int n)
//{
//	int i = 0;
//	for (i = 0; i < n; i++)
//	{
//		printf("%d ", arr[i]);
//	}
//}
//void reverse(int* arr, int n)
//{
//	int start = 0;
//	int end = n - 1;
//	while (start < end)
//	{
//		int temp = arr[start];
//		arr[start] = arr[end];
//		arr[end] = temp;
//		start++;
//		end--;
//	}
//}
//int main()
//{
//	int array[10];
//	int n;
//	scanf("%d", &n);
//	init(array, n);
//	my_printf(array, n);
//	reverse(array, n);
//	printf("\n");
//	my_printf(array, n);
//	return 0;
//}
//#define _CRT_SECURE_NO_WARNINGS
//#define _CRT_SECURE_NO_WARNINGS
//#include<stdio.h>
//struct stu
//{
//	char name[20];
//	char num[5];
//	char sex[5];
//	int tel;
//};
//struct peo
//{
//	char name[5];
//	int n;
//	int m;
//
//};
//struct x
//{
//	int x : 5;
//	int y : 6;
//	int z : 15;
//};
//void print(struct stu* s1)
//{
//	printf("%s %s %s %d", s1->name, s1->num, s1->sex, s1->tel);
//}
//int main()
//{
//	struct stu s1 = { "zxl","1234","nv",520 };
//	struct stu s2 = { 0 };
//	struct peo p1 = { 0 };
//	struct x x1 = { 0 };
//	print(&s1);
//	printf("\n");
//	printf("%d\n", (int)sizeof(x1));
//	/*printf("%d\n", (int)sizeof(int));
//	printf("%d", (int)sizeof(char));*/
//	return 0;
#include<stdio.h>
#include<string.h>

int main(void)
{
    int n;
    scanf("%d", &n);
    int li=0, zhang=0, sun=0;
    int i = 0;
    for (i = 0; i < n; i++)
    {
        char name[20];
        scanf("%s", &name);
        if (strcmp(name, "Li") == 0)
        {
            li++;
        }
        if (strcmp(name, "Zhang") == 0)
        {
            zhang++;
        }
        if (strcmp(name, "Sun") == 0)
            sun++;
    }
    printf("Li:%d\n", li);
    printf("Zhang:%d\n", zhang);
    printf("Sun:%d\n", sun);
    return 0;
}

每天继续加油!

相关推荐
小年糕是糕手18 分钟前
【C++】C++入门 -- 输入&输出、缺省参数
c语言·开发语言·数据结构·c++·算法·leetcode·排序算法
Star在努力2 小时前
C语言复习八(2025.11.18)
c语言·算法·排序算法
赖small强2 小时前
【Linux C/C++开发】第26章:系统级综合项目理论
linux·c语言·c++
仟濹3 小时前
【C/C++】经典高精度算法 5道题 加减乘除「复习」
c语言·c++·算法
车端域控测试工程师3 小时前
Autosar网络管理测试用例 - TC003
c语言·开发语言·学习·汽车·测试用例·capl·canoe
EXtreme355 小时前
征服 C 语言文件 I/O:透视数据流、FILE* 核心机制与高效实践全指南
c语言··文件io
Bona Sun6 小时前
单片机手搓掌上游戏机(十二)—esp8266运行gameboy模拟器之编译上传
c语言·c++·单片机·游戏机
星期天27 小时前
3.2联合体和枚举enum,还有动态内存malloc,free,calloc,realloc
c语言·开发语言·算法·联合体·动态内存·初学者入门·枚举enum
自信150413057598 小时前
初学者小白复盘23之——联合与枚举
c语言·1024程序员节
秃秃秃秃哇9 小时前
C语言实现循环链表demo
linux·c语言·链表