codeup之C语言10.10
生活随笔
收集整理的這篇文章主要介紹了
codeup之C语言10.10
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
Description
給定字符串定義char *a = “I love China!”,讀入整數(shù)n,輸出在進行了a = a + n這個賦值操作以后字符指針a對應的字符串。
Input
一個整數(shù)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之矩阵转置