DEV C++ 輸入 數字 Scanf
scanf("%lf", &y[i]);
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
double y[5],z[5];
int i;
for (i=0;i<=4;i++)
{
printf("enter a y[] number: ");
scanf("%lf", &y[i]);
printf("enter a z[] number: ");
scanf("%lf", &z[i]);
printf("%lf\n", y[i]);
printf("%lf\n", z[i]);
}
printf("enter any key to exit");
fflush(stdin);
getchar();
return 0;
}
沒有留言:
張貼留言