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 <stdio.h>

#define N 8

int main(void){
    char buf[N+1];
    char ptn[N][N];
    
    for (int y=0; y<N; y++){
        scanf("%s", buf);
        for (int x=0; x<N; x++){
            ptn[x][y]=buf[x];
        }
    }
    
    puts("90");
    for (int y=0; y<N; y++){
        for (int x=0; x<N; x++){
            printf("%c",ptn[y][N-1-x]);
        }
        printf("\n");
    }
    puts("180");
    for (int y=0; y<N; y++){
        for (int x=0; x<N; x++){
            printf("%c",ptn[N-1-x][N-1-y]);
        }
        printf("\n");
    }
    puts("270");
    for (int y=0; y<N; y++){
        for (int x=0; x<N; x++){
            printf("%c",ptn[N-1-y][x]);
        }
        printf("\n");
    }
    
    
    return 0;
}

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

char t[10][10];

void rotate(void){
	char tmp[10][10];
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			tmp[j][7-i] = t[i][j];
		}
	}

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

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

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

	return 0;
}

C++: #include <iostream>
using namespace std;
char c[10][10] = {};

void view(){
	for(int i = 0 ; i < 8 ; i++){
		for(int j = 0 ; j < 8 ; j++)
			cout << c[i][j];
		cout << endl;
	}
}
int main(){
	for(int i = 0 ; i < 8 ; i++)
		for(int j = 0 ; j < 8 ; j++)
			cin >> c[i][j];
	for(int i = 1 ; i <= 3 ; i++){
		cout << i * 90 << endl;
		for(int j = 0 ; j < 8 ; j++)
			for(int k = j+1 ; k < 8 ; k++)
				swap(c[j][k],c[k][j]);
		for(int j = 0 ; j < 8 ; j++){
			for(int k = 0 ; k < 4 ; k++)
				swap(c[j][k],c[j][7-k]);
		}
		view();
	}
	
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
#define N_MAX 8
#define rep(i,n) for(int i=0;i<n;i++)

char p[N_MAX][N_MAX];

void rotate(){
	rep(i,N_MAX)rep(j,i)swap(p[i][j],p[j][i]);
	rep(i,N_MAX)reverse(p[i],p[i]+N_MAX);
	rep(i,N_MAX){
		rep(j,N_MAX)cout <<p[i][j];
		cout << endl;
	}
}

int main(){
	rep(i,N_MAX)rep(j,N_MAX)cin >> p[i][j];
	cout << 90 << endl;
	rotate();
	cout << 180 << endl;
	rotate();
	cout << 270 << endl;
	rotate();
}

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

char map[12][12];

void rotate(){
	char bM[8][9];
	memcpy(bM,map,72);
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			map[i][j]=bM[7-j][i];
		}
	}
}

void showmap(){
	for(int i=0;i<8;i++){
		printf("%s\n",map[i]);
	}
}
int main(void){
	memset(map,'\0',sizeof(map));
	for(int j=0;j<=7;j++){
		cin >> map[j];
	}
	printf("90\n");
	rotate();
	showmap();
	printf("180\n");
	rotate();
	showmap();
	printf("270\n");
	rotate();
	showmap();
    return 0;
}

C++: //Name: Rotation of a Pattern
//Level: 2
//Category: シミュレーション
//Note: 

/**
 * がんばる。
 */
#include <iostream>
#include <vector>
#include <string>

using namespace std;

const int S = 8;
void rotate(vector<string> &v) {
    for(int r = 0; r < S/2; ++r) {
        for(int c = 0; c < S/2; ++c) {
            const char tmp = v[r][c];
            v[r][c] = v[S-c-1][r];
            v[S-c-1][r] = v[S-r-1][S-c-1];
            v[S-r-1][S-c-1] = v[c][S-r-1];
            v[c][S-r-1] = tmp;
        }
    }
}

template<typename T>
ostream& operator <<(ostream &os, const vector<T> &v) {
    for(const T &t : v) {
        os << t << endl;
    }
    return os;
}

bool solve(bool first) {
    vector<string> v(S);
    for(int i = 0; i < S; ++i) {
        cin >> v[i];
    }
    for(int r = 90; r <= 270; r += 90) {
        cout << r << endl;
        rotate(v);
        cout << v;
    }
    return false;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout.setf(ios::fixed);
    cout.precision(10);

    bool first = true;
    while(solve(first)) {
        first = false;
    }
    return 0;
}

C++: #include<iostream>

using namespace std;

char data[8][8];

int main(){


  for(int i = 0; i < 8; i++){
    for(int j = 0; j < 8; j++){
      cin >> data[i][j];
    }
  }
  cout << "90" << endl;


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

  cout << "180" <<endl;

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

  cout << "270" << endl;


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

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

char field[8][8];
char tmp[8][8];
int angle = 90;

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(){
	cout << angle << endl;
	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];
		}
	}

	for(int i=0; i < 3; i++, angle += 90){
		rotate();
		output();
	}
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
char board[10][10];
int main(){
	rep(i,8){
		rep(j,8){
			cin>>board[i][j];
		}
	}
	char tmp[10][10];
	rep(i,8)rep(j,8)tmp[i][j]=board[i][j];
	cout <<90<<endl;
	for(int i =0;i < 8;i++){
		for(int j =0;j <8;j++){
			tmp[i][j]=board[7-j][i];
		}
	}
	rep(i,8){
		rep(j,8){
			cout<<tmp[i][j];
		}
		cout <<endl;
	}
	cout <<180<<endl;
	rep(i,8)rep(j,8)board[i][j]=tmp[i][j];
	for(int i =0;i < 8;i++){
		for(int j =0;j <8;j++){
			tmp[i][j]=board[7-j][i];
		}
	}
	rep(i,8){
		rep(j,8){
			cout<<tmp[i][j];
		}
		cout <<endl;
	}
	cout <<270<<endl;
	rep(i,8)rep(j,8)board[i][j]=tmp[i][j];
	for(int i =0;i < 8;i++){
		for(int j =0;j <8;j++){
			tmp[i][j]=board[7-j][i];
		}
	}
	rep(i,8){
		rep(j,8){
			cout<<tmp[i][j];
		}
		cout <<endl;
	}
	return 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=7;j>=0;j--){
			cout<<masu[j][i];
		}
		cout<<endl;
	}
	return 0;
}