codeup之C语言10.10
生活随笔
收集整理的这篇文章主要介绍了
codeup之C语言10.10
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
Description
给定字符串定义char *a = “I love China!”,读入整数n,输出在进行了a = a + n这个赋值操作以后字符指针a对应的字符串。
Input
一个整数n,保证0<=n<13.
Output
输出进行了题目描述中赋值操作之后a对应的字符串。
请注意行尾输出换行。
Sample Input Copy
7
Sample Output Copy
China!
solution
#include <stdio.h>
#include <string.h>
int main(){
char *a = "I love China!";
int n;
scanf("%d", &n);
for(int i = n; i < strlen(a); i++){
printf("%c", *(a + i));
}
return 0;
}
总结
以上是生活随笔为你收集整理的codeup之C语言10.10的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: Partition to K Equal
- 下一篇: codeup之矩阵转置