01/10/2018, 14:18
Mọi người giúp e chuyển 2 đoạn code này qua C với ạ! e đã thử tự chuyển mà nó cứ báo lỗi
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <conio.h>
#include <string.h>
#include <fstream>
using namespace std;
int n,ex=0;
struct HS
{
string ho;
string ten;
string kv;
string khoi;
float d1,d2,d3,dt,live;
};
struct HS arr[1000];
//xoa man hinh
void clrscr()
{
system("cls");
printf("QUAN LY KET QUA TUYEN SINH
");
}
//in ra thong tin 1 thi sinh
void Print(int stt,string ho, string ten, string kv, string khoi, int d1, int d2, int d3, int dt){
cout << " " << stt;
cout << " " << ho << " ";
cout << ten << " ";
cout << kv << " ";
cout << khoi << " ";
cout << d1 << " " << d2 << " " << d3 << " " << dt << endl;
}
và
//ghi lai du lieu
void ReWrite(int nn)
{
ofstream fo;
fo.open("QLHS.txt");
fo << nn << endl;
for (int i=1; i<=n; i++)
if (arr[i].live ==1)
{
fo << arr[i].ho << endl;
fo << arr[i].ten << endl;
fo << arr[i].kv << endl;
fo << arr[i].khoi << endl;
fo << arr[i].d1 << " " << arr[i].d2 << " " << arr[i].d3 << " " << arr[i].dt << " " << arr[i].live << endl;
}
fo.close();
Load();
}
Bài liên quan
format code lại cho dễ đọc đi bạn
A post was merged into an existing topic: Topic chứa các reply được cho là off-topic - version 2
Bạn ơi đua code chuyển của bạn bị lỗi lên. Mọi người sẽ giúp sữa lỗi phần nào. Chứ nhờ 100% vậy thì mình khóa topic nhé.