View Code of Problem 78

#include <iostream>
#include <string.h>
using namespace std;

int main(){
  char a[100],b[100],c[100],t[100];
  scanf("%s%s%s",a,b,c);
  if(strcmp(a,b)>0)
  {
    strcpy(t,b);
    strcpy(b,a);
    strcpy(a,t);
  }
  if(strcmp(a,c)>0)
  {
    strcpy(t,a);
    strcpy(a,c);
    strcpy(c,t);
  }
  if(strcmp(b,c)>0)
  {
    strcpy(t,b);
    strcpy(b,c);
    strcpy(c,t);
  }
  
  printf("%s\n%s\n%s",a,b,c);
  return 0;
}

Double click to view unformatted code.


Back to problem 78