#include #include #include #include #include #include #define SIZE 30 void swap(char * a[]){ char temp[10]; strcpy(temp,*a[0]); strcpy(*a[0],*a[2]); strcpy(*a[2],temp); } //returnType (*functionName)(paramType1, paramType2, ...) using namespace std; int main(){ //part 1 char ab[2][10], c[10], d[10]; char * array[4]; char * temp; fgets(ab[0],10,stdin); strtok(ab[0],"\n"); fgets(ab[1],10,stdin); strtok(ab[1],"\n"); fgets(c,10,stdin); strtok(c,"\n"); fgets(d,10,stdin); strtok(d,"\n"); //end part 1 //part 2 array[0]=ab[0]; array[1]=ab[1]; array[2]=c; array[3]=d; //end part 2 //part 3 temp=array[1]; array[1]=array[3]; array[3]=temp; //end part 3 //part 4 swap(array); //end part 4 //part 5 //end part 5 system("pause"); }