From 104bf4c570774ed400276cdcc869c7116beeaf73 Mon Sep 17 00:00:00 2001 From: "liuq1016@qq.com" Date: Tue, 8 Jan 2019 09:37:55 +0800 Subject: [PATCH] third --- 8-7.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 8-7.cpp diff --git a/8-7.cpp b/8-7.cpp new file mode 100644 index 0000000..4983df7 --- /dev/null +++ b/8-7.cpp @@ -0,0 +1,16 @@ +#include +int main(void) +{ + int i, a[10], *p=a; + printf("Please enter 10 integers: \n"); +for(p=a;p-a<10; p++) + scanf("%d", p); + + printf("------ Output ------\n"); + p=a; /* 把指针重新指向数组首地址 */ + for(i=0; i<10; i++) + printf("%4d", *p++); + printf("\n"); + return 0; + } +