#include <stdio.h> #define N 5 void check(double *a){ int i; double w; for(i=0;i<N;i++){ w = a[i]; if(w >= 25.0){ printf("%6.1f\n",a[i]); } } } int main(void){ double n[] = {10.5,28.7,4.8,120.9,20.8}; check(n); return 0; }
#include <stdio.h> #define N 5 void check(double *a){ int i; double w; for(i=0;i<N;i++){ w = a[i]; if(w >= 25.0){ printf("%6.1f\n",a[i]); } } } int main(void){ double n[] = {10.5,28.7,4.8,120.9,20.8}; check(n); return 0; }
コメント