Cho mình hỏi là sao minh nhập điểm số thực vào thì nó không in ra số thực được v.ai biêt sai chỗ nào chỉ giùm mk với. thanks mọi người nhiều
#include<iostream>
#include<cstring>
using namespace std;
struct info{
char name[50];
char lop[20];
float d_tindc;
};
int main(){
int n;
struct info sv[60];
do{
cout<<"\n enter number of student (2<=n<=20):";
cin>>n;
}while(n<2||n>20);
fflush(stdin);
//nhap vao thong tin sinh vien.
for(int i=0;i<n;i++){
cout<<"\n sinh vien thu "<<i+1<<":";
cout<<"\n Ho va ten:";
gets(sv[i].name);
cout<<"\n Lop:";
gets(sv[i].lop);
cout<<"\n Diem thi tin dai cuong:";
cin>>sv[i].d_tindc;
fflush(stdin);
}
system("cls");
//in ra man hinh thong tin cua sinh vien
for(int i=0;i<n;i++){
cout<<"\n Sinh vien thu"<<i+1<<":";
cout<<"\nHo va ten:"<<sv[i].name<<"\tLop "<<sv[i].lop<<"\tDiem tin dai cuong"<<sv[i].d_tindc;
}
cout<<endl;
system("pause");
return 0;
}

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