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 <string>

using namespace std;

int main(){
  string strs[8];
  for(int i = 0; i < 8; i++){
    cin >> strs[i];
  }
  cout << 90 << "\n";
  for(int i = 0; i < 8; i++){
    for(int j = 7; j >= 0; j--){
      cout << strs[j][i];
    }
    cout << "\n";
  }
  cout << 180 << "\n";
  for(int i = 7; i >= 0; i--){
    for(int j = 7; j >= 0; j--){
      cout << strs[i][j];
    }
    cout << "\n";
  }
  cout << 270 << "\n";
  for(int i = 0; i < 8; i++){
    for(int j = 7; j >= 0; j--){
      cout << strs[i][j];
    }
    cout << "\n";
  }
  return 0;
}

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

int main(void){
	char map[8][8];
	for(int j=0;j<=7;j++){
		scanf("%s",map[j]);
	}
	printf("90\n");
	for(int i=7;i>=0;i--){
		for(int j=0;j<=7;j++){
			printf("%c",map[i][j]);
		}
		printf("\n");
	}
	printf("180\n");
	for(int i=7;i>=0;i--){
		for(int j=7;j>=0;j--){
			printf("%c",map[i][j]);
		}
		printf("\n");
	}
	printf("270\n");
	for(int i=0;i<=7;i++){
		for(int j=7;j>=0;j--){
			printf("%c",map[i][j]);
		}
		printf("\n");
	}
    return 0;
}

C++: #include <stdio.h>
#include <string.h>
#include <ctype.h>
int main ( void ) {
    char input[8][8];
    int i,t,n[8],cnt=0;
    for(i=0;i<8;i++){//入力
        scanf("%s",input[i]);
        n[cnt]=strlen(input[i]);
        cnt++;
    }
    puts("90");
    for(i=0;i<8;i++){
        for(t=7;t>=0;t--){
            printf("%c",input[t][i]);
        }
        puts("");
    } 
    puts("180");
    for(i=7;i>=0;i--){
        for(t=7;t>=0;t--){
            printf("%c",input[i][t]);
        }
        puts("");
    }
    puts("270");
    for(i=7;i>=0;i--){
        for(t=0;t<8;t++){
            printf("%c",input[t][i]);
        }
        puts("");
    }
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	string in[8];
	int n=8;
	rep(i,8)cin>>in[i];
	cout<<90<<endl;
	rep(i,n){rep(j,n)cout<<in[7-j][i];cout<<endl;}
	cout<<180<<endl;
	rep(i,n){rep(j,n)cout<<in[7-i][7-j];cout<<endl;}
	cout<<270<<endl;
	rep(i,n){rep(j,n)cout<<in[j][7-i];cout<<endl;}	
}

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

int main(){
char c[4][8][8];
for(int a=0;a<8;a++){
	for(int b=0;b<8;b++)cin>>c[0][a][b];
}
for(int d=1;d<4;d++){
	for(int e=0;e<8;e++){
		for(int f=0;f<8;f++){
			c[d][e][f]=c[d-1][f][7-e];
		}
	}
}
for(int x=3;x!=0;x--){
	printf("%d\n",(4-x)*90);
	for(int y=0;y<8;y++){
		for(int z=0;z<8;z++)printf("%c",c[x][y][z]);
		puts("");
	}
}
}

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

//90度回転の方法が理解できたら、それを3回するだけ

char field[10][10];
char tmp[10][10];

void rotate(){
	for(int i=0; i < 8; i++){
		for(int j=0; j < 8; j++){
			tmp[i][j] = field[i][j];
		}
	}

	for(int i=0; i < 8; i++){
		for(int j=0; j < 8; j++){
			field[i][j] = tmp[7-j][i];
		}
	}
}

void output(){
	for(int i=0; i < 8; i++){
		for(int j=0; j < 8; j++){
			cout << field[i][j];
		}
		cout << endl;
	}
}

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


	cout << 90 << endl;
	rotate();
	output();

	cout << 180 << endl;
	rotate();
	output();

	cout << 270 << endl;
	rotate();
	output();
}

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

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

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

int main () {
	vector<string> t(8);
	for (int i = 0; i < 8; i++) {
		cin >> t[i];
	}
	for (int i = 0; i < 3; i++) {
		vector<string> res = t;
		for (int y = 0; y < 8; y++) {
			for (int x = 0; x < 8; x++) {
				t[x][8 - y - 1] = res[y][x];
			}
		}
		cout << 90 * (i + 1) << endl;
		for (int j = 0; j < 8; j++) {
			cout << t[j] << endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>
#include <string.h>

#define MAX 8
char table[MAX][MAX];

void rotate_90()
{
	char tmp[MAX][MAX];
	for ( int i = 0 ; i < MAX ; i++ ) {
		for ( int j = 0 ; j < MAX ; j++ ) {
			tmp[j][(MAX-1)-i] = table[i][j];	
		}
	}

	memcpy( table, tmp, sizeof( table ) );
}

void print_table() 
{
	for ( int i = 0 ; i < MAX ; i++ ) {
		for ( int j = 0 ; j < MAX ; j++ ) {
			printf( "%c", table[i][j] );
		}
		printf( "\n" );
	}
}

int main()
{
	int i = 0;

	for ( i = 0 ; i < MAX ; i++ ) {
		scanf( "%s", table[i] );
	}

	for ( i = 1 ; i < 4 ; i++ ) {
		rotate_90();
		printf( "%d\n", 90 * i );
		print_table();
	}

	return 0;
}

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

char field[10][10];

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

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

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

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

int main() {


  string a[8],b[8];

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


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

  for(int i=0;i<8;i++) b[i] = a[i];

  for(int i=0;i<8;i++)
    cout << a[i] << endl;
  }

  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    string str[8];
    for(int i=0;i<8;i++)cin>>str[i];
    cout<<"90\n";
    for(int i=0;i<8;i++){
        for(int j=7;j>-1;j--)cout<<str[j][i];
        cout<<endl;
    }
    cout<<"180\n";
    for(int i=7;i>-1;i--){
        for(int j=7;j>-1;j--)cout<<str[i][j];
        cout<<endl;
    }
    cout<<"270\n";
    for(int i=7;i>-1;i--){
        for(int j=0;j<8;j++)cout<<str[j][i];
        cout<<endl;
    }
}