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>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main()
{
    vector<vector<string> > s(2, vector<string>(8, string(8, '.')));
    rep(i, 8) cin >> s[0][i];
    rep(k, 3) {
        cout << 90 * (k + 1) << endl;
        rep(i, 8) rep(j, 8) s[(k+1)%2][i][j] = s[k%2][7-j][i];
        rep(i, 8) cout << s[(k+1)%2][i] << endl;
    }
    return 0;
}

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

int x[8][8];
int y[8][8];
char c;

void TheRotate90() {
	for (int i = 0; i < 8; i++) {
		for (int j = 0; j < 8; j++) {
			y[j][7 - i] = x[i][j];
		}
	}
}

int main() {
	for (int i = 0; i < 8; i++) {
		for (int j = 0; j < 8; j++) {
			cin >> c;
			if (c == '#') { x[i][j] = 1; }
			else { x[i][j] = 0; }
		}
	}
	for (int i = 90; i <= 270; i += 90) {
		cout << i << endl;
		TheRotate90();
		for (int j = 0; j < 8; j++) {
			for (int k = 0; k < 8; k++) {
				x[j][k] = y[j][k];
				if (x[j][k] == 0) { cout << '*'; }
				else { cout << '#'; }
			}
			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][j][MAX - i - 1] = map[x - 1][i][j];
            }
        }
    }
    
    for (int x = 1; x < 4; x++){
        printf("%d\n", x * 90);
        for (int i = 0; i < MAX; i++){
            map[x][i][MAX] = '\0';
            printf("%s\n", map[x][i]);
        }
    }
    
    return (0);
}

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

int main(){

  char ehe[100][100];

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

  cout << "90" << endl;

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

  cout << "180" << endl;

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

  cout << "270" << endl;

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

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];
		}
		cout << endl;
	}
}

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

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

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

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

char x[10][10];
char y[10][10];

void TheRotate90() {
	for (int j = 0; j < 8; j++) {
		for (int k = 0; k < 8; k++) {
			y[k][7 - j] = x[j][k];
		}
	}
}

int main() {
	for (int i = 0; i < 8; i++) {
		for (int j = 0; j < 8; j++) {
			cin >> x[i][j];
		}
	}
	for (int i = 1; i < 4; i++) {
		cout << i * 90 << endl;
		TheRotate90();
		for (int j = 0; j < 8; j++) {
			for (int k = 0; k < 8; k++) {
				x[j][k] = y[j][k];
				cout << x[j][k];
			}
			cout << endl;
		}
	}
	return 0;
}

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

int x[8][8];
int y[8][8];
char c;

void TheRotate90() {
	for (int i = 0; i < 8; i++) {
		for (int j = 0; j < 8; j++) {
			double X1 = 1.0*i - 3.5;
			double Y1 = 1.0*j - 3.5;
			double X2 = Y1;
			double Y2 = -X1;
			int X3 = (double)3.5 + X2;
			int Y3 = (double)3.5 + Y2;
			y[X3][Y3] = x[i][j];
		}
	}
}

int main() {
	for (int i = 0; i < 8; i++) {
		for (int j = 0; j < 8; j++) {
			cin >> c;
			if (c == '#') { x[i][j] = 1; }
			else { x[i][j] = 0; }
		}
	}
	for (int i = 90; i <= 270; i += 90) {
		cout << i << endl;
		TheRotate90();
		for (int j = 0; j < 8; j++) {
			for (int k = 0; k < 8; k++) {
				x[j][k] = y[j][k];
				if (x[j][k] == 0) { cout << '*'; }
				else { cout << '#'; }
			}
			cout << endl;
		}
	}
	return 0;
}