题解 | #复制部分字符串#
复制部分字符串
https://www.nowcoder.com/practice/8f5b923683b94e549880e3c8370e3e55
#include<stdio.h> #include<stdlib.h> int main() { char * str; str = (char*)malloc(30*sizeof(char)); scanf("%s",str); int n; scanf("%d",&n); printf("%s",str+n-1);//str指向h,h+6=o,因此h+(n-1) return 0; }