![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/76927734e07558b8d46392fe1192044a.png)
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(int argc, const char *argv[])
{
int arr1[300]={1,1};
int n;
scanf("%d",&n);
for(int i = 2;i < n;i++)
{
arr1[i] = arr1[i-1] + arr1[i-2];
printf("%d\n",arr1[i]);
}
return 0;
}
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/1fde77d20ecbc1f4b6f24627f64dd28b.png)
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(int argc, const char *argv[])
{
int i;
int count = 0;
char str1[100] = "";
gets(str1);
for(i = 0;i<=strlen(str1);i++)
{
if(str1[i] == ' ')
count++;
}
printf("空格的个数为:%d\n",count);
return 0;
}
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(int argc, const char *argv[])
{
int da = 0;
int xiao = 0;
int shuzi = 0;
int fuhao = 0;
char arr2[100];
scanf("%s",arr2);
for(int i = 0;arr2[i] != '\0';i++)
{
if(arr2[i] >= 'A' && arr2[i]<= 'Z')
da++;}
for(int i = 0;arr2[i] != '\0';i++)
{ if(arr2[i] >= 'a' && arr2[i]<= 'z')
xiao++;}
for(int i = 0;arr2[i] != '\0';i++)
{ if(arr2[i] >= '0' && arr2[i]<= '9')
shuzi++;}
for(int i = 0;arr2[i] != '\0';i++)
{ if(ispunct(arr2[i]))
fuhao++;
}
printf("大写个数:%d,小写个数%d,数字个数%d,符号个数%d\n",da,xiao,shuzi,fuhao);
return 0;
}