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;
}

每天继续加油!

相关推荐
C++ 老炮儿的技术栈14 分钟前
Linux 动态库踩坑:明明重新编译了 .so,调用函数返回值却一直不变(libfjrobot.so 版本号异常排查实录)
linux·c语言·网络·c++·visual studio
小向是个Der9 小时前
嵌入式进阶——MCU上电后的动作
c语言·单片机·mcu·学习·链接脚本
bkspiderx12 小时前
基于Socket的广播通信及C语言实现详解
c语言·开发语言·socket·广播·socket的广播通信
LDR00616 小时前
LDR6100 智能遥控器精品软文:Type-C 充电口与低功耗量产维护
c语言·开发语言
FLJwu19 小时前
运动相机采购实战|第四篇(终章):一张清单走完选型全流程,把风险拦在源头
c语言·开发语言·数码相机·运动相机·oem 量产
简单电磁炮1 天前
关于can的调试
c语言·stm32·单片机
超级架构师1 天前
让 COBOL 长出 AI 大脑:原生 Agent 核心框架 praxo-core 深度剖析
c语言·开发语言·c++·人工智能·python·架构·ai编程
·present·1 天前
CSAPP(lecture 10)
c语言·c++
邪修king1 天前
Re:Linux系统篇(三十八):进程间通信ChapterSystem V 信号量深度解析|同步互斥、内核源码、C 指针多态、实战代码
java·linux·c语言
学逆向的1 天前
C 堆区内存管理
c语言·开发语言·网络安全