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

每天继续加油!

相关推荐
云:鸢1 小时前
C语言链表设计及应用
c语言·开发语言·数据结构·链表
正在起飞的蜗牛3 小时前
【C语言】函数指针的使用分析:回调、代码逻辑优化、代码架构分层
c语言·架构
饭碗的彼岸one3 小时前
C++ 并发编程:异步任务
c语言·开发语言·c++·后端·c·异步
水饺编程4 小时前
Windows 命令行:cd 命令3,当前目录,父目录,根目录
c语言·c++·windows·visual studio
kyle~4 小时前
C/C++---动态内存管理(new delete)
c语言·开发语言·c++
Yuki’6 小时前
网络编程---UDP
c语言·网络·网络协议·udp
.YM.Z6 小时前
C语言——文件操作
c语言·文件操作
GanGuaGua7 小时前
Linux系统:线程的互斥和安全
linux·运维·服务器·c语言·c++·安全
神里流~霜灭10 小时前
(C++)数据结构初阶(顺序表的实现)
linux·c语言·数据结构·c++·算法·顺序表·单链表
草莓熊Lotso11 小时前
【C++】递归与迭代:两种编程范式的对比与实践
c语言·开发语言·c++·经验分享·笔记·其他