//设计某年是否为瑞年//设计strlen函数版本
//设计某年是否为瑞年#include<stdio.h>
int main(void)
{
int year;
printf("请输入年份")
scanf_s("%d", &year);
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
printf("%d is leap year", year);
else
printf("%d is not leap year", year);
return 0;
}
//设计strlen函数版本
#include<stdio.h>
int strlen(char s[]);
int main()
{
char s[] = "bkdxbjflkzsf";
printf("%d", strlen(s));
return 0;
}
int strlen(char s[])
{
int i;
i = 0;
while (s != '\0')
++i;
return i;
页:
[1]