View Code of Problem 78

#include<iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <cmath>
using namespace std;
//#pragma warning(disable:4996)


int main() {
	char s1[100], s2[100], s3[100], temp[100];
	gets(s1);
	gets(s2);
	gets(s3);
	if (strcmp(s1, s2) > 0) {
		strcpy(temp, s1);
		strcpy(s1, s2);
		strcpy(s2, temp);
	}
	if (strcmp(s1, s3) > 0) {
		strcpy(temp, s1);
		strcpy(s1, s3);
		strcpy(s3, temp);
	}
	if (strcmp(s2, s3) > 0) {
		strcpy(temp, s2);
		strcpy(s2, s3);
		strcpy(s3, temp);
	}
	puts(s1);
	puts(s2);
	puts(s3);
	return 0;
}	

Double click to view unformatted code.


Back to problem 78