Auto commit
This commit is contained in:
parent
777ac955d0
commit
152541650a
25
2207/C语言同步练习源码/4.函数-2.c
Normal file
25
2207/C语言同步练习源码/4.函数-2.c
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
void change(char *p){
|
||||||
|
//alex apple
|
||||||
|
*p++ -= 32;//a-> -32 ->A
|
||||||
|
while(*p != '#'){
|
||||||
|
if(*(p-1) == ' '){
|
||||||
|
*p -= 32;
|
||||||
|
}
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
*p = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
char str[1024];
|
||||||
|
|
||||||
|
gets(str);//读取一行字符串 回车判定结束
|
||||||
|
change(str);
|
||||||
|
puts(str);
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -667,12 +667,43 @@ int main(){
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
```c
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
void change(char *p){
|
||||||
|
//alex apple
|
||||||
|
*p++ -= 32;//a-> -32 ->A
|
||||||
|
while(*p != '#'){
|
||||||
|
if(*(p-1) == ' '){
|
||||||
|
*p -= 32;
|
||||||
|
}
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
*p = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
char str[1024];
|
||||||
|
|
||||||
|
gets(str);//读取一行字符串 回车判定结束
|
||||||
|
change(str);
|
||||||
|
puts(str);
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 函数-3
|
### 函数-3
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
```c
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 指针
|
## 指针
|
||||||
|
Loading…
x
Reference in New Issue
Block a user