Structs Hackerrank Solution in C++
For Explanation Watch Video:
Sample Input
15
john
carmack
10
Sample Output
15 john carmack 10
Code:
#include <cmath>#include <cstdio>#include <vector>#include <iostream>#include <algorithm>using namespace std;
/* add code for struct here.*/struct Student{ int age,standard; string first_name,last_name;};
int main() { Student st; cin >> st.age >> st.first_name >> st.last_name >> st.standard; cout << st.age << " " << st.first_name << " " << st.last_name << " " << st.standard; return 0;}
Comments
Post a Comment