Skip to content

Instantly share code, notes, and snippets.

@andrinur13
Created February 5, 2019 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrinur13/4a6f2b9dbf0b0135ac9666fdfa9cd4b0 to your computer and use it in GitHub Desktop.
Save andrinur13/4a6f2b9dbf0b0135ac9666fdfa9cd4b0 to your computer and use it in GitHub Desktop.
miftah
#include <iostream>
using namespace std;
struct n {
int math;
int ipa;
int ips;
};
struct siswa {
string nama;
n nilai;
};
int mat, ipa, ips;
bool cek(siswa) {
if(mat < 60 || ipa < 60 || ips < 60) {
return false;
} else {
return true;
}
}
main() {
siswa rian;
cin >> rian.nama;
cin >> rian.nilai.math;
cin >> rian.nilai.ipa;
cin >> rian.nilai.ips;
if(cek(rian)) {
cout << rian.nama << " Lulus" << endl;
} else {
cout << rian.nama << " Tidak lulus" << endl;
}
mat = rian.nilai.math;
ipa = rian.nilai.ipa;
ips = rian.nilai.ips;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment