Go: package main

import (
	"bufio"
	"os"
	"fmt"
	"strings"
	)

var scanner = bufio.NewScanner(os.Stdin)
var title = [4]int{0, 90, 180, 270}

func main() {
	p := make([][]string, 8)
	for i := range p {
		scanner.Scan()
		p[i] = strings.Split(scanner.Text(), "")
	}
	// log.Println(p)
	for i := 1; i < 4; i++ {
		fmt.Println(title[i])
		p = spin(p)
		print_p(p)
	}
}

func spin(p [][]string) [][]string {
	ret := make([][]string, 8)
	for i := range ret {
		ret[i] = make([]string, 8)
	}
	for i := 0; i < 8; i++ {
		for j := 0; j < 8; j++ {
			ret[i][j] = p[7-j][i]
		}
	}
	return ret
}

func print_p(p [][]string) {
	for _, v := range p {
		fmt.Println(strings.Join(v, ""))
	}
}

C++: #include <iostream>
using namespace std;
int main(void) {
  char tile[8][8];

  for(int i = 0 ; i < 8 ; i++) {
    for(int j = 0 ; j < 8 ; j++) {
      cin >> tile[i][j];
    }
  }
  
  cout << "90" << endl;
  for(int i = 7 ; i >= 0 ; i--) {
    for(int j = 0 ; j < 8 ; j++) {
      cout << tile[i][j];
    }
    cout << endl;
  }

  cout << "180" << endl;
  for(int i = 7 ; i >= 0 ; i--) {
    for(int j = 7 ; j >= 0 ; j--) {
      cout << tile[i][j];
    }
    cout << endl;
  }

  cout << "270" << endl;
  for(int i = 0 ; i < 8 ; i++) {
    for(int j = 7 ; j >= 0 ; j--) {
      cout << tile[i][j];
    }
    cout << endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

#define rep(i,n) for(int i = 0 ; i < n ; i++)

int main(){
  char a[10][10][4];

  rep(i,8){
    rep(j,8){
      cin >> a[i][j][0];
    }
  }

  rep(k,3){
    cout << (k+1)*90 << endl;
    rep(i,8){
      rep(j,8){
	cout << a[7-j][i][k];
	a[i][j][k+1] = a[7-j][i][k];
      }
      cout << endl;
    }
  }

  return 0;
}

C++: #include <cstdio>
#include <cstring>
using namespace std;

int main()
{
	char s[8][9];
	
	for(int i = 0; i < 8; i++){
		scanf("%s", s[i]);
	}
	
	int num = 90;
	while(num <= 270){
		
		printf("%d\n", num);
		char tmp[9],t;
		strcpy(tmp, s[0]);
		t = s[7][0];
	
		for(int i = 7; i > 0; i--){
			s[0][i] = s[i][0];
			s[i][0] = s[7][i];
			s[7][i] = s[i][7];
			s[i][7] = tmp[i];
		}
		s[0][7] = s[0][0];
		s[0][0] = t;
	
		for(int i = 0; i < 8; i++){
				printf("%s\n", s[i]);
		}
		num  += 90;
	}
	return(0);
}

C++: #include<iostream>
using namespace std;
#define rep(i, n) for ( int i = 0; i < n; i++)

main(){
    char P[8][8], T[8][8];
    rep(i, 8) rep(j, 8) cin >> P[i][j];
    for ( int d = 90; d < 360; d += 90 ){
	cout << d << endl;
	rep(i, 8) rep(j, 8) T[i][j] = P[i][j];
	rep(i, 8) rep(j, 8) P[j][8-i-1] = T[i][j];
	rep(i, 8){
	    rep(j, 8) cout << P[i][j];
	    cout << endl;
	} 
    }
}

C++: #include <iostream>
using namespace std;

int main() {
    char input[8][9] = {};
    for (int i = 0; i < 8; i++) {
        cin >> input[i];
    }
    for (int i = 0; i < 3; i++) {
        cout << (i + 1) * 90 << endl;
        char output[8][9] = {};
        for (int y = 0; y < 8; y++) {
            for (int x = 0; x < 8; x++) {
                output[y][x] = input[7 - x][y];
            }
        }
        for (int j = 0; j < 8; j++) {
            cout << output[j] << endl;
        }
        for (int y = 0; y < 8; y++) {
            for (int x = 0; x < 8; x++) {
                input[y][x] = output[y][x];
            }
        }
    }
}

C++: #include<iostream>

using namespace std;

char data[8][8];

int main(){


  for(int i = 0; i < 8; i++){
    for(int j = 0; j < 8; j++){
      cin >> data[i][j];
    }
  }
  cout << "90" << endl;

  for(int i = 7; i >= 0; i--){
    for(int j = 0; j < 8; j++){
      cout << data[i][j];
    }
    cout << endl;
  }

  cout << "180" <<endl;

  for(int i = 7; i >= 0; i--){
    for(int j = 7; j >= 0; j--){
      cout << data[i][j];
    }
    cout << endl;
  }

  cout << "270" << endl;

  for(int i = 0; i < 8; i++){
    for(int j = 7; j >=0; j--){
      cout << data[i][j];
    }
    cout << endl;
  } 
  return 0;
}

C++: #include <iostream>
using namespace std;

int main(){
    char pattern[8][8];
    for(int i=0;i<8;i++){
        for(int j=0;j<8;j++){
            cin >> pattern[i][j];
        }
    }
    
    cout << 90 << endl;
    for(int i=0;i<8;i++){
        for(int j=7;j>=0;j--){
            cout << pattern[j][i];
        }
        cout << endl;
    }
    
    cout << 180 << endl;
    for(int i=7;i>=0;i--){
        for(int j=7;j>=0;j--){
            cout << pattern[i][j];
        }
        cout << endl;
    }
    
    cout << 270 << endl;
    for(int i=7;i>=0;i--){
        for(int j=0;j<8;j++){
            cout << pattern[j][i];
        }
        cout << endl;
    }
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector<string> VS;
typedef int INT;
typedef vector<INT> VI;
typedef vector<VI> VVI;
typedef pair <INT, INT> II;
typedef vector <II> VII;

template<class T> ostream& operator << ( ostream& os, vector<T> v ) {
    for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++it_i ) {
        os << *it_i << ", ";
    }
    return os;
}


VS rot( VS L ) {
    VS res = L;
    for ( int i = 0; i < 8; ++ i ) {
        for ( int j = 0; j < 8; ++ j ) {
            res[j][7-i] = L[i][j];
        }
    }
    return res;
}

void print( VS L ) {
    for ( int i = 0; i < 8; ++ i ) {
        cout << L[i] << endl;
    }
}

int main() {
    VS L(8);
    for ( int i = 0; i < 8; ++ i ) {
        cin >> L[i];
    }
    cout << 90 << endl;
    print( rot( L ) );
    cout << 180 << endl;
    print( rot( rot( L ) ) );
    cout << 270 << endl;
    print( rot( rot( rot( L ) ) ) );
    return 0;
}

C++: #include <iostream>
#include <cstring>
int main(){
	char map[8][8],t_m[8][8];
	for(int i=0;i<8;i++){
		std::cin >> map[i];
	}

	for(int i=1;i<4;i++){
		//ツ角ツ度ツ閉ェ(ツ９ツ０ツ，ツ１ツ８ツ０ツ，ツ２ツ７ツ０)ツ嘉アツ転ツつオツつスツ配ツ療アツづーツ催ャツづゥ
		for(int y=0;y<8;y++){
			for(int x=0;x<8;x++){
				t_m[7-x][y] = map[y][x];
			}
		}

		memcpy(map,t_m,sizeof(t_m));

		std::cout << 90 * i << std::endl;
		for(int y=0;y<8;y++){
			for(int x=0;x<8;x++){
				std::cout << map[y][x];
			}
			std::cout << "\n";
		}
	}
}

C++: #include <bits/stdc++.h>

typedef long long ll;
using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	char c[8][8];

	for (int i = 0;i < 8;i++){
		for (int j = 0;j < 8;j++){
			cin >> c[i][j];
		}
	}

	cout << 90 << endl;	

	for (int i = 0;i < 8;i++){
		for (int j = 0;j < 8;j++){
			cout << c[7-j][i];
		}
		cout << endl;
	}

	cout << 180 << endl;

	for (int i = 0;i < 8;i++){
		for (int j = 0;j < 8;j++){
			cout << c[7-i][7-j];
		}
		cout << endl;
	}

	cout << 270 << endl;

	for (int i = 0;i < 8;i++){
		for (int j = 0;j < 8;j++){
			cout << c[i][7-j];
		}
		cout << endl;
	}

	return 0;

}

C++: #include <iostream>
#include <cstdio>
using namespace std;

char M[3][8][8];
int main() {
  
  char dum;
  for(int i = 0; i < 8; i++) {
    for(int j = 0; j < 8; j++) {
      scanf("%c", &M[0][i][j]);
    }
    scanf("%c", &dum);
  }
  
  
  for(int k = 0; k < 3; k++) {
    cout << 90*(k+1) << endl;
    for(int i = 0; i < 8; i++) {
      for(int j = 0; j < 8; j++) {
	cout << M[k][7-j][i];
	if(k!=2) M[k+1][i][j] = M[k][7-j][i];
      }
      cout << endl;
    }
  }
  return 0;
}