摘要: 1 #include<stdio.h> 2 int main() 3 { 4 char str[100]; 5 int n=1; 6 gets(str); 7 str[0]-=32; //首单词无法判断先直接修改 8 while(str[n]!='\0') //遍历字符串 9 { 10 if(str 阅读全文
posted @ 2021-04-10 21:05 新生代农民工 阅读(1431) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 int main() 3 { 4 int num[10]={1,2,3,4,5,6,7,8,9,10},num1[10]; 5 int i,j,k; 6 double average=0; 7 for(i=0;i<10;i++) //算平均数 8 aver 阅读全文
posted @ 2021-04-10 20:53 新生代农民工 阅读(703) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 int fun(char *s) 4 { 5 int counter=0,flag=1; 6 while(*s) //遍历数组 7 { 8 if(*s==' ') //一个空格代表一个单词结束 9 flag=1 阅读全文
posted @ 2021-04-10 19:50 新生代农民工 阅读(84) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 void fun(char *p,int n) 3 { 4 int i,j; 5 char *ch,*ch1; 6 ch=ch1=p; 7 i=j=0; 8 while(*ch!='\0') //遍历到数组最后位置 9 ch++; 10 ch--; //删 阅读全文
posted @ 2021-04-10 16:22 新生代农民工 阅读(1536) 评论(0) 推荐(0)
摘要: 解题思路:从非*号进行入手对数组进行部分重写 1 #include<stdio.h> 2 char * fun(char a[]) 3 { 4 int i,j; 5 i=j=0; 6 while(a[j]=='*')//先跳过前导* 7 { 8 j++; 9 i++; 10 } 11 for(;a[ 阅读全文
posted @ 2021-04-10 10:37 新生代农民工 阅读(233) 评论(0) 推荐(0)