用c语言键盘输入若干个数,进行求和,直到输入某个数例0为止

日期:2017-01-13 01:35:00 人气:1

用c语言键盘输入若干个数,进行求和,直到输入某个数例0为止

#include int main ( void ) { int i, totle = 0; do { scanf ( "%d", &n ); totle += n; }while ( n ) printf ( "结果为: %d\n", totle ); return 0; }
    A+
热门评论