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>
#include <stdio.h>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <iomanip>
#include <vector>
using namespace std;
#define ll long long
#define fill(a,b) memset(a,b,sizeof(a))
#define rep(i,n) for(ll i=0;i<n;++i)
#define Sort(a) sort(a.begin(),a.end())
int main(){
    char n[8][8];
    rep(i,8){
        rep(j,8){
            cin>>n[i][j];
        }
    }
    cout<<90<<endl;
    rep(i,8){
        for(int j=7;j>=0;j--){
                cout<<n[j][i];
        }
        cout<<endl;
    }
    cout<<180<<endl;
    for(int i=7;i>=0;i--){
        for(int j=7;j>=0;j--)
        {cout<<n[i][j];}
        cout<<endl;
    }
    cout<<270<<endl;
    for(int i=7;i>=0;i--){
        rep(j,8){cout<<n[j][i];}
        cout<<endl;
    }

    return 0;
}

C++: #include <bits/stdc++.h>
 
using namespace std;
 
int main()
{
    char a[8][8][4];

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

    }

    for (int k = 0; k < 3; k++) {
        cout << (k + 1) * 90 << endl;
        for (int i = 0; i < 8; i++) {
            for (int j = 0; j < 8; j++) {
		cout << a[7-j][i][k];
		a[i][j][k+1] = a[7-j][i][k];
            }
            cout << endl;
        }
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
string t;
char str[8][8],tmp[8][8];
int main(){
  for(int i=0;i<8;i++){
    cin>>t;
    for(int j=0;j<8;j++){
      str[i][j]=t[j];
    }
  }

  for(int i=90;i<360;i+=90){
    cout<<i<<endl;

    for(int j=0;j<8;j++)
      for(int k=0;k<8;k++)
	tmp[j][k]=str[j][k];
    


    for(int j=0;j<8;j++){
      for(int k=0;k<8;k++){
	str[j][k]=tmp[7-k][j];
	cout<<str[j][k];
      }
      cout<<endl;
    }

  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

char c[8][8];

int main(){
	REP(i, 8){
		REP(j, 8){
			cin >> c[i][j];
		}
	}
	cout << 90 << endl;
	for (int j = 0; j < 8; j++){
		for (int i = 7; i >= 0; i--){
			cout << c[i][j];
		}
		cout << endl;
	}
	cout << 180 << endl;
	for (int i = 7; i >= 0; i--){
		for (int j = 7; j >= 0; j--){
			cout << c[i][j];
		}
		cout << endl;
	}
	cout << 270 << endl;
	for (int j = 7; j >= 0; j--){
		for (int i = 0; i <= 8; i++){
			cout << c[i][j];
		}
		if(j!=0)cout << endl;
	}
}

C++: #include <stdio.h>

int main(void)
{
	char str1[8][9];
	char str2[8][9];
	int i, j, k;
	int n;
	
	for (i = 0; i < 8; i++){
			scanf("%s", str1[i]);
	}
	
	for (n = 1; n <= 3; n++){
		
		printf("%d\n", n * 90);
		
		for (i = 0; i < 8; i++){
			for (j = 0, k = 7; j < 8; j++, k--){
				str2[i][j] = str1[k][i];
			}
			str2[i][8] = '\0';
		}
		
		for (i = 0; i < 8; i++){
			for (j = 0; j < 9; j++){
				str1[i][j] = str2[i][j];
			}
		}
		
		for (i = 0; i < 8; i++){
			printf("%s\n", str1[i]);
		}
	}
	return (0);
}

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][8-i] = L[i][j];
        }
    }
    return res;
}

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

C++: #include <iostream>
using namespace std;
string b[8];
int main() {
    for (int i=0; i<8; i++) cin>>b[i];
    cout<<90<<endl;
    for (int i=0; i<8; i++) {
        for (int j=7; j>=0; j--) {
            cout<<b[j][i];
        }
        cout<<endl;
    }
    cout<<180<<endl;
    for (int i=7; i>=0; i--) {
        for (int j=7; j>=0; j--) {
            cout<<b[i][j];
        }
        cout<<endl;
    }
    cout<<270<<endl;
    for (int i=7; i>=0; i--) {
        for (int j=0; j<8; j++) {
            cout<<b[j][i];
        }
        cout<<endl;
    }
}

C++: #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
int main(){
  string s[8];
  for(int i=0;i<8;i++)cin>>s[i];
  cout << 90 << endl;
  for(int i=0;i<8;i++){
    for(int j=0;j<8;j++){
      cout<<s[7-j][i];
    }
    cout<<endl;
  }
  cout<<180<<endl;
  for(int i=0;i<8;i++){
    for(int j=0;j<8;j++){
      cout<<s[7-i][7-j];
    }
    cout<<endl;
  }
  cout<<270<<endl;
  for(int i=0;i<8;i++){
    for(int j=0;j<8;j++){
      cout<<s[i][7-j];
    }
    cout<<endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std ;

char table[8][8] ;

void f(){
	char tmp[8][8] ;
	for( int y=0 ; y<8 ; y++ ){
		for( int x=0 ; x<8 ; x++ ){
			tmp[y][x] = table[7-x][y] ;
		}
	}
	swap( table , tmp ) ;
}

main(){
	
	for( int i=0 ; i<8 ; i++ )
		for( int j=0 ; j<8 ; j++ )
			cin >> table[i][j] ;
	
	for( int i=90 ; i<360 ; i+=90 ){
		cout << i << endl ;
		f() ;
		for( int j=0 ; j<8 ; j++ ){
			for( int k=0 ; k<8 ; k++ ) cout << table[j][k] ;
			cout << endl ;
		}
	}
}

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

int main(){
  string mat[8][8];
  
  for(int i = 0 ; i < 8 ; i++)
    for(int j = 0 ; j < 8 ; j++)
      cin >> mat[i][j];

  cout << "90" << endl;
  for(int i = 0 ; i < 8 ; i++)
    for(int j = 0 ; j < 8 ; j++)
      cout << mat[8-i-1][j];

  cout << "180" << endl;
  for(int i = 0 ; i < 8 ; i++)
    for(int j = 0 ; j < 8 ; j++)
      cout << mat[8-i-1][8-j-1];

  cout << "270" << endl;
  for(int i = 0 ; i < 8 ; i++)
    for(int j = 0 ; j < 8 ; j++)
      cout << mat[i][8-j-1];



  return 0;
}

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

string m[8], n[8];


int main(){
    for (int i = 0; i < 8; i++)	cin >> m[i];
    
    for (int i = 1; i <= 3; i++){
	
	for (int j = 0; j < 8; j++) n[j] = m[j];
	
	for (int k = 0; k < 8; k++){
	    for (int l = 0; l < 8; l++){
		n[k][l] = m[7-l][k];
	    }
	}
	for (int k = 0; k < 8; k++){
	    for (int l = 0; l < 8; l++){
		m[k][l] = n[k][l];
	    }
	}
	
	cout << i * 90 << endl;
	for (int l = 0; l < 8; l++) cout << n[l] << endl;
    }
}