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;
char map[8][8],cop[8][8];
int main(){
	for(int i=0;i<8;i++)
		for(int j=0;j<8;j++)
			cin>>cop[i][j];
	for(int u=1;u<=3;u++){
		cout<<u*90<<endl;
		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++){
				map[i][j]=cop[7-j][i];
				cout<<map[i][j];
			}
			cout<<endl;
		}
		for(int i=0;i<8;i++)
			for(int j=0;j<8;j++)
				cop[i][j]=map[i][j];
	}
	return 0;
}

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

C++: #include<stdio.h>
#include<string.h>
int main(){
	char m[9][9],s[9][9];
	int i,j,k=0;
	for(j=0;j<8;j++){
		scanf("%s",m[j]);
		strcpy(s[j],m[j]);
	}
	for(k=90;k<360;k+=90){
		printf("%d\n",k);
		for(i=0;i<8;i++){
			for(j=0;j<8;j++){
				s[j][7-i]=m[i][j];
			}
		}
		for(j=0;j<8;j++){
			printf("%s\n",s[j]);
			strcpy(m[j],s[j]);
		}
	}
    return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n)           REPEAT(i, 0, n)
#define REPEAT(i, k, n)     for(int i = (k); i < (k+n); ++i)
#define FROMTO(i,f,t)       for(int i = f; i < t; i++)

vector<string> rotate(vector<string> &v){
    int w = v[0].size(), h = v.size();
    vector<string> r(w);
    REP(i,w) r[i].resize(h);
    REP(y,h) REP(x,w) r[x][h-y-1] = v[y][x];
    return r;
}

int main(){
    vector<string> v(8);
    REP(i,8) cin >> v[i];
    FROMTO(i,1,4){
        cout << 90*i << endl;
        v = rotate(v);
        REP(j,v.size()) cout << v[j] << endl;
    }
    return 0;
}

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


char a[8][8];
int rxx[]={ 0,-1, 0};
int ryx[]={ 1, 0,-1};
int rxy[]={-1, 0, 1};
int ryy[]={ 0,-1, 0};
int dx[]={0,7,7};
int dy[]={7,7,0};

int main(){
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++)cin>>a[i][j];
	}
	for(int i=0;i<3;i++){
		cout<<(i+1)*90<<endl;
		for(int j=0;j<8;j++){
			for(int k=0;k<8;k++)cout<<a[j*ryy[i]+k*rxy[i]+dy[i]][j*ryx[i]+k*rxx[i]+dx[i]];
			cout<<endl;
		}
		
	}
	return 0;
}

C++: // 2011/02/03 Tazoe

#include <iostream>
using namespace std;

int main()
{
	char pat[8][8];

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

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

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

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

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <string>
#include <cmath>
#include <map>
#include <vector>
#include <sstream>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)

using namespace std;
typedef long long ll;


void kai(string z[], int hk){
	string w[8];
	fill(w,w+8,"          ");
	if(hk==1)
		rep(i,8) rep(j,8) w[j][7-i]=z[i][j];
	else if(hk==2)
		rep(i,8) rep(j,8) w[7-i][7-j]=z[i][j];
	else
		rep(i,8) rep(j,8) w[7-j][i]=z[i][j];
	rep(i,8) cout << w[i] << endl;
}

int main() {
	string ba[8];
	
	rep(i,8) cin >> ba[i];
	cout << "90" << endl;
	kai(ba,1);
	cout << "180" << endl;
	kai(ba,2);
	cout << "270" << endl;
	kai(ba,3);
	
	return 0;
}

C++: #include<stdio.h>
int main()
{
	const int N = 8;
	char a[N][N+1];
	int i,j;
	for(;;)
	{
		for(i = 0; i < N; ++i)
			if( scanf("%s",a[i]) != 1) return 0;
		puts("90");
		for(j=0;j<N;++j)
		{
			for(i = N-1;i>=0;--i)
				putchar(a[i][j]);
			putchar('\n');
		}
		puts("180");
		for(i=N-1;i>=0;--i)
		{
			for(j=N-1;j>=0;--j)
				putchar(a[i][j]);
			putchar('\n');
		}
		puts("270");
		for(j=N-1;j>=0;--j)
		{
			for(i=0;i<N;++i)
				putchar(a[i][j]);
			putchar('\n');
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>

using namespace std;

char grid[8][8];

void rotate(){

  char tmp[8][8];
  for(int i=0;i<8;i++)
    for(int j=0;j<8;j++)
      tmp[i][j]=grid[7-j][i];

  for(int i=0;i<8;i++)
    for(int j=0;j<8;j++)
      grid[i][j]=tmp[i][j];
}

void print(){

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

int main(void){

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

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

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

  cout << 270 << endl;
  rotate();
  print();

  return 0;
}

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

using namespace std;

char p[8][8];

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

    for(int i = 0; i < 3; ++i) {
        cout << 90 * (i + 1) << endl;
        for(int j = 0; j < 8; j++) {
            for(int k = 0; k < 8; k++) {
                char c;
                if(i == 0) {
                    c = p[7-j][k];

                } else if(i == 1) {
                    c = p[7-j][7-k];
                } else {
                    c = p[j][7-k];

                }
                cout << c;
            }
            cout << endl;
        }
    }
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstdio>

using namespace std;

void rotate90(string *Asqu, string *Bsqu)
{
	for(int k = 0; k < 8; k++)
	{
		string sent;
		for(int i = 7; i >= 0; i--)
		{
			sent += Asqu[i][k];
		}	
		Bsqu[k] = sent;
	}
}

void printC(string *Asqu)
{
	for(int i = 0; i < 8; i++)
	{
		cout << Asqu[i] << endl;
	}
}

int main()
{
	string Asqu[16], Bsqu[16];

	for(int i = 0; i < 8; i++)
	{
		cin >> Asqu[i];
	}
	rotate90(Asqu, Bsqu);
	puts("90");
	printC(Bsqu);

	rotate90(Bsqu, Asqu);
	puts("180");
	printC(Asqu);

	rotate90(Asqu, Bsqu);
	puts("270");
	printC(Bsqu);
	
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<map>
#include<queue>
#include<set>

using namespace std;
typedef pair<int,int> PII;
typedef long long ll;

int main(){
	vector<string> pattern(8);
  for(int i=0;i<8;i++)
		cin>>pattern[i];
	cout<<90<<endl;
	for(int y=0;y<8;y++){
		for(int x=0;x<8;x++){
			cout<<pattern[7-x][y];
		}
		cout<<endl;
	}
	cout<<180<<endl;
	for(int y=0;y<8;y++){
		for(int x=0;x<8;x++){
			cout<<pattern[7-y][7-x];
		}
		cout<<endl;
	}
	cout<<270<<endl;
	for(int y=0;y<8;y++){
		for(int x=0;x<8;x++){
			cout<<pattern[x][7-y];
		}
		cout<<endl;
	}
  return 0;
}