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

每天继续加油!

相关推荐
阿捏利3 小时前
C Primer Plus 第6版 编程练习——第7章(上)
c语言·编程题·c primer plus
jz_ddk3 小时前
[实战]调频(FM)和调幅(AM)信号生成(完整C语言实现)
c语言·算法·信号处理
码农Cloudy.4 小时前
C语言<数据结构-链表>
c语言·数据结构·链表
星竹晨L4 小时前
C语言——预处理详解
c语言·开发语言
lightqjx5 小时前
【数据结构】顺序表(sequential list)
c语言·开发语言·数据结构·算法
小立爱学习6 小时前
Linux 内存管理之address_space
linux·c语言
玖別ԅ(¯﹃¯ԅ)7 小时前
文件追加模式:编写一个程序,向一个已存在的文件末尾追加内容。
c语言
C语言小火车10 小时前
野指针:C/C++内存管理的“幽灵陷阱”与系统化规避策略
c语言·c++·学习·指针
凤年徐11 小时前
【数据结构】时间复杂度和空间复杂度
c语言·数据结构·c++·笔记·算法
鑫宇吖11 小时前
Polyspace作为MISRA-C合规性检查工具,其检查规则会根据目标C语言标准(C90或C99)动态调整限值要求。
c语言·嵌入式·c99·c90·polyspace·misra-c合规性检查