标签:code class for pre include color 处理 std printf
#include<stdio.h> void print_string(char s[]) { printf("%s", s); } int strlen(char *s) { int n; for(n = 0; *s != ‘\0‘; s ++) n ++; return n; } int main() { char s[] = "hello world!"; for(int i = 0; i <= strlen(s); i ++){ print_string(s + i); printf("\n"); } }
运行结果:
hello world!
ello world!
llo world!
lo world!
o world!
world!
world!
orld!
rld!
ld!
标签:code class for pre include color 处理 std printf
原文地址:http://www.cnblogs.com/xkxf/p/6119884.html