Friday, August 26, 2016

uri-1172 Array Replacement I

#include<stdio.h>

int main()
{
    int i,n;
    int arr[10];

    for(i=0;i<=9;i++){
            scanf("%d",&arr[n]);
            if(arr[n]<=0)
             printf("X[%d] = 1\n",i);
            else
             printf("X[%d] = %d\n",i,arr[n]);
    }
    return 0;
}

No comments: