Mn kiểm tra giúp e kết quả bài này với ạ! Cái chỗ tổng nó lại không ra đúng kết quả :((
#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int dem,tong,x;
dem=0;
tong=0;
do
{
cout<<"nhap so thu "<<(dem+1)<<":";
cin>>x;
dem++;
tong=tong+x;
}
while(x!=-1);
dem=dem-1;
cout<<"Co "<<dem<<" so trong day so"<<endl;
cout<<"tong cac chu so la: "<<tong;
return 0;
}

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?