标题:烦请路过的大神们修改下程序
取消只看楼主
pl123586
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2016-10-13
结帖率:0
 问题点数:0 回复次数:0 
烦请路过的大神们修改下程序
#include <stdio.h>
#include <stdlib.h>
#define len 10
int main(){
    int array[len]={1,2,3,4,5,6,7,8,9,10},*ptr,i;
 
    ptr=array;
    for(i=0;i<len;i++)
    scanf("%d",ptr+i);

    for(i=0;i<len;i++){
      if(i%2==0){
        printf("*%d",*(ptr+i));}
    else                                                                                                                                                                                                                                                                                                                                                                           
      printf("\n");
}
    system("PAUSE");
    return 0;
 }
 题目:指针实现:输入一个10个元素数组,输出数组奇数位置的元素。
搜索更多相关主题的帖子: include 
2016-12-01 15:58



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-471855-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.119062 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved