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<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>
#include<numeric>
#define INF 1e+8
#define EPS 0
#define PB push_back
#define fi first
#define se second
#define reps(i,j,k) for(int i = j; i < k; i++)
#define rep(i,j) reps(i,0,j)
using namespace std;
const int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
typedef long long ll;
typedef pair<int,int> Pii;
int main(){
	char field[10][10][2]={{0}};
	rep(i,8){
		char x[10];
		scanf("%s",x);
		rep(j,8){
			field[i][j][0] = x[j];
		}
	}
	rep(n,3){
		printf("%d\n",90+90*n);
		rep(i,8){
			rep(j,8){
				field[j][7-i][(n+1)%2] = field[i][j][n%2];
			}
		}
		rep(i,8){
			rep(j,8){
				printf("%c",field[i][j][(n+1)%2]);
			}
			puts("");
		}
	}
	return 0;
}

C++: #include <cstdio>

#define MAX (8)

int main(void)
{
    char map[4][MAX][MAX + 1];
    
    for (int i = 0; i < MAX; i++){
        scanf("%s", map[0][i]);
    }
    
    for (int x = 1; x < 4; x++){
        for (int i = 0; i < MAX; i++){
            for (int j = 0; j < MAX; j++){
                map[x][i][j] = map[x - 1][j][MAX - i - 1];
            }
        }
    }
    
    for (int x = 3; x != 0; x--){
        printf("%d\n", 270 / x);
        for (int i = 0; i < MAX; i++){
            map[x][i][MAX] = '\0';
            printf("%s\n", map[x][i]);
        }
    }
    
    return (0);
}

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

C++: #include <iostream>
#include <cstdio>

using namespace std;

void roll();

char pattern[10][10];
char tmp[10][10];

int main()
{
	for (int i = 0; i < 8; i++){
		scanf("%s", pattern[i]);
	}
	
	for (int j = 0; j < 3; j++){
		roll();
		printf("%d\n", (j + 1) * 90);
		//cout << (j + 1) * 90 << endl;
		for (int i = 0; i < 8; i++){
			printf("%s\n", pattern[i]);
		}
	}
	return (0); 
}

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

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
 
using namespace std;
 
#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
 
typedef vector<int> vi;
typedef pair<int,int> pii;
 
int main(void) {
  int i,j;
  char v[10][10]={};
  rep(i,8)
    cin>>v[i];
  puts("90");
  rep(i,8){
    rep(j,8)
      cout<<v[7-j][i];
    cout<<endl;
  }
  puts("180");
  rep(i,8){
    rep(j,8)
      cout<<v[7-i][7-j];
    cout<<endl;
  }
  puts("270");
  rep(i,8){
    rep(j,8)
      cout<<v[j][7-i];
    cout<<endl;
  }
}

C++: #include <iostream>

using namespace std;

int main(void){

  char r[8][8];

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

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

  return 0;
}

C++: #include<iostream>
#include<string>
#define N 8

using namespace std;

int main(){
  int i, j;
  string data[N];

  for(i=0; i<N; ++i)
    cin >> data[i];

  cout << "90" << endl;
  for(i=0; i<N; ++i){
    for(j=0; j<N; ++j)
      cout << data[N-1-j][i];
    cout << endl;
  }

  cout << "180" << endl;
  for(i=0; i<N; ++i){
    for(j=0; j<N; ++j)
      cout << data[N-1-i][N-1-j];
    cout << endl;
  }

  cout << "270" << endl;
  for(i=0; i<N; ++i){
    for(j=0; j<N; ++j)
      cout << data[j][N-1-i];
    cout << endl;
  }

  return 0;
}

C++: #include <cstdio>

#define MAX (8)

int main(void)
{
    char map[4][MAX][MAX + 1];
    
    for (int i = 0; i < MAX; i++){
        scanf("%s", map[0][i]);
    }
    
    for (int x = 1; x < 4; x++){
        for (int i = 0; i < MAX; i++){
            for (int j = 0; j < MAX; j++){
                map[x][i][j] = map[x - 1][j][MAX - i - 1];
            }
        }
    }
    
    for (int x = 1; x < 4; x++){
        printf("%d\n", 270 / x);
        for (int i = 0; i < MAX; i++){
            map[x][i][MAX] = '\0';
            printf("%s\n", map[x][i]);
        }
    }
    
    return (0);
}