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(){
  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];



  retunrn 0;
}

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

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
#include <set>
using namespace std;
int main(){
	
	string s[8];
	
	for(int i=0;i<8;i++)
		cin>>s[i];
	cout<<90<<endl;
	for(int i=7;i>=0;i--)
		cout<<s[i]<<endl;
	cout<<180<<endl;
	for(int i=7;i>=0;i--){
		for(int j=7;j>=0;j--)
			cout<<s[i][j];
		cout<<endl;
	}
	cout<<270<<endl;
	for(int i=0;i<8;i++){
		for(int j=7;j>=0;j--)
			cout<<s[i][j];
		cout<<endl;
	}
	
	
	
}

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

char P[9][9];
char Q[9][9];

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

C++: #include<iostream>
int i,j;main(){std::string s[8],t;for(;i<8;)getline(std::cin,s[i++]);for(t="90\n";i-->0;t+="\n")for(j=8;j-->0;)t+=s[j][7-i];for(t+="180\n";++i<8;t+="\n")for(j=8;j-->0;)t+=s[7-i][j];for(t+="270\n";i-->0;t+="\n")for(j=0;j<8;)t+=s[j++][i];std::cout<<t;}

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

using namespace std;

char grid[8][8];

void rotate90() {
  char temp[8][8];
  
  for(int i=0; i<8; i++) {
    for(int j=0; j<8; j++) {
      temp[i][j] = grid[8-j-1][i];
    }
  }
  
  memcpy(grid, temp, sizeof(grid));
  
}

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

  for(int i=0; i<3; i++) {
    cout << (i+1)*90 << endl;
    rotate90();
    
    for(int j=0; j<8; j++) {
      for(int k=0; k<8; k++) {
	cout << grid[j][k];
      }
      cout << endl;
    }

  }
  
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<string>
using namespace std;
int main(){
    char s[10][10];
    for(int i=0;i<8;i++)cin>>s[i];

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


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

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

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define repb(i,n,l) for(int i=n;i>=0;i--)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main(){
	char c[8][8]={};
	rep(i,0,8){
		rep(j,0,8){
			cin>>c[i][j];
		}
	}
	o(90);
	rep(i,0,8){
		repb(j,7,0){
			cout<<c[j][i];
		}
		cout<<endl;
	}
	o(180);
	repb(i,7,0){
		repb(j,7,0){
			cout<<c[i][j];
		}
		cout<<endl;
	}
	o(270);
	repb(i,7,0){
		rep(j,0,8){
			cout<<c[j][i];
		}
		cout<<endl;
	}

}

C++: #include <iostream>

using namespace std;

int main(){
        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[j][7-i];
                }  
                cout << endl;
        }  
}

C++: #include <iostream>

using namespace std;

int main()
{
    char inp[8][9];

    for (int i = 0; i < 8; i++)
        cin >> inp[i];

    cout << "90" << endl;
    for (int i = 7; i >= 0; i--)
        cout << inp[i] << endl;

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

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

C++: #include <stdio.h>
int main(){
    char a[8][8];
    for(int i=0;i<8;i++){
        scanf("%s",a[i]);
    }
    printf("90\n");
    for(int j=0;j<8;j++){
        for(int i=7;i>=0;i--){
            printf("%c",a[i][j]);
        }
        printf("\n");
    }
    printf("180\n");
    for(int i=7;i>=0;i--){
        for(int j=7;j>=0;j--){
            printf("%c",a[i][j]);
        }
        printf("\n");
    }
    printf("270\n");
    for(int j=7;j>=0;j--){
        for(int i=0;i<8;i++){
            printf("%c",a[i][j]);
        }
        printf("\n");
    }
}