Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- struct Student {
- string name;
- string surname;
- float grade;
- Student *next
- };
- Student *head = null;
- Student *tail = null;
- void sort(Student *ptr) {
- bool swap = false;
- bool sorted = false;
- int i = 0;
- while(sorted == false){
- Student *temp;
- for(int i=0;i<4-1;i++){
- if(*(ptr+i)->grade > *(ptr+i+1)->grade){
- temp = *(ptr+i);
- *(ptr+i) = *(ptr+i+1);
- *(ptr+i+1) = temp;
- swap = true;
- }
- }
- if(swap == true){
- sorted = false;
- } else {
- sorted = true;
- }
- swap = false;
- }
- }
- int main() {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement