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

每天继续加油!

相关推荐
知南x5 小时前
【Ascend C系列课程(高级)】(1) 算子调试+调优
c语言·开发语言
2的n次方_7 小时前
Runtime 执行提交机制:NPU 硬件队列的管理与任务原子化下发
c语言·开发语言
凡人叶枫7 小时前
C++中智能指针详解(Linux实战版)| 彻底解决内存泄漏,新手也能吃透
java·linux·c语言·开发语言·c++·嵌入式开发
凡人叶枫9 小时前
C++中输入、输出和文件操作详解(Linux实战版)| 从基础到项目落地,避坑指南
linux·服务器·c语言·开发语言·c++
傻乐u兔10 小时前
C语言进阶————指针3
c语言·开发语言
CodeSheep程序羊11 小时前
拼多多春节加班工资曝光,没几个敢给这个数的。
java·c语言·开发语言·c++·python·程序人生·职场和发展
I'mChloe11 小时前
PTO-ISA 深度解析:PyPTO 范式生成的底层指令集与 NPU 算子执行的硬件映射
c语言·开发语言
2的n次方_12 小时前
Runtime 内存管理深化:推理批处理下的内存复用与生命周期精细控制
c语言·网络·架构
嵌入小生00712 小时前
标准IO---核心函数接口延续(嵌入式Linux)
c语言·vscode·vim·嵌入式·小白·标准io·函数接口
历程里程碑13 小时前
Linux20 : IO
linux·c语言·开发语言·数据结构·c++·算法