c语言课已件第7章数组7.pptVIP

  • 1
  • 0
  • 约4.13千字
  • 约 55页
  • 2021-04-01 发布于福建
  • 举报
t=(w1+w2+w3+w4+w5+w6+w7+w8+w9+w10)/10; if( w1 t ) printf( %d\n, w1 ); if( w2 t ) printf( %d\n, w2 ); if( w3 t ) printf( %d\n, w3 ); if( w4 t ) printf( % d\n, w4 ); if( w5 t ) printf( %d\n, w5 ); if( w6 t ) printf( %d\n, w6 ); if( w7 t ) printf( %d\n, w7 ); if( w8 t ) printf( %d\n, w8 ); if( w9 t ) printf( %d\n, w9 ); if( w10 t ) printf( %d\n, w10 ); };用数组来解决问题: main() { int w[10]; /* 定义 1 个整型数组存放体重 */ int t, i; for( i=0; i10; i++ ) scanf( %d, w[i] ); for( t=0; i=0; i10; i++ ) t = t + w[i]; t = t/10; for( i=0; i10; i++ )

文档评论(0)

1亿VIP精品文档

相关文档