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>
using namespace std;

int main() {
	vector<string> v;
	for(int i = 0; i < 8; i++) {
		string s;
		cin >> s;
		v.push_back(s);
	}

	for(int i = 1; i <= 3; i++) {
		cout << i * 90 << endl;
		for(int j = 0; j < 8; j++) {
			for(int k = 0; k < 8; k++) {
				char c;
				switch(i) {
					case 1: c = v[7 - k][j]; break;
					case 2: c = v[7 - j][7 - k]; break;
					case 3: c = v[k][7 - j]; break;
				}
				cout << c;
			}
			cout << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
#include<vector>
#include<string>
typedef unsigned long long ull;
#define rep(i,a) for(int i=0;i<a;i++)
#define loop(i,a,b) for(int i=a;i<b;i++)
using namespace std;
const double eps = 1e-10;
const double pi = acos(-1);
const double inf = (int)1e8;

void solve(){
  vector<vector<char> > maze(8,vector<char>(8));
  rep(i,8)rep(j,8)cin>>maze[i][j];
  int rand = 0;
  
  rep(i,3){
    vector<vector<char> >  move(8,vector<char>(8));
    cout<<(rand+=90)<<endl;
    
    rep(i,8)rep(j,8)
	move[i][j]=maze[7-j][i];
    rep(i,8){
      rep(j,8)cout<<move[i][j];
      cout<<endl;
    }
    maze=move;
    //if(maze==move)cout<<"OK!"<<endl;
  }
}

int main(void){
  solve();
  return 0;
}

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

C++: #include<iostream>
#include<cmath>
#include<vector>
#include<string>
typedef unsigned long long ull;
#define rep(i,a) for(int i=0;i<a;i++)
#define loop(i,a,b) for(int i=a;i<b;i++)
using namespace std;
const double eps = 1e-10;
const double pi = acos(-1);
const double inf = (int)1e8;

void solve(){
  vector<vector<char> > maze(8,vector<char>(8));
  rep(i,8)rep(j,8)cin>>maze[i][j];
  int rand = 0;
  
  rep(i,3){
    vector<vector<char> >  move(8,vector<char>(8));
    cout<<(rand+=90)<<endl;
    
    rep(i,8)rep(j,8)
	move[i][j]=maze[7-j][i];
    rep(i,8){
      rep(j,8)cout<<move[i][j];
      cout<<endl;
    }
    maze=move;
  }
}

int main(void){
  solve();
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

vector <string> rotate90 (vector <string> src )
{
	int size = src.size();
	vector <string> res (8, string(8, ' ' ) );

	int i,j;
	
	for (i = 0; i < size; ++i){
		for (j = 0; j < size; ++j){
			res[j][size - 1 - i] = src[i][j];
 		} // end for
	} // end for

	return res;
}

void disp_pattern (vector <string> p )
{
	int size = p.size();
	int i,j;

	for (i = 0; i < size; ++i){
		for (j = 0; j < size; ++j){
			cout << p[i][j];
		} // end for
		cout << endl;
	} // end for
}

int main()
{
	const string ang[] = { "90", "180", "270" };

//	cut here before submit 
//	freopen ("testcase.pattern", "r", stdin );
	string str = "";
	vector <string> pattern (8);
	int i;
	
	for (i = 0; i < 8; ++i){
		getline (cin, str );
		pattern[i] = str;
	} // end for

	vector <string> res;

	// for debug
//	disp_pattern (pattern );

	for (i = 0; i < 3; ++i){
		res = rotate90 (pattern );
		cout << ang[i] << endl;
		disp_pattern (res );
		pattern = res;
	} // end for

	return 0;
}

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	vector<string>v;
	rep(i, 0, 8) {
		string s; cin >> s; v.push_back(s);
	}

	cout << 90 << endl;
	rep(i, 0, 8) {
		rrep(j, 0, 8) {
			cout << v[j][i];
		}
		cout << endl;
	}
	
	cout << 180 << endl;
	rrep(i, 0, 8) {
		rrep(j, 0, 8) {
			cout << v[i][j];
		}
		cout << endl;
	}

	cout << 270 << endl;
	rep(i, 0, 8) {
		rrep(j, 0, 8) {
			cout << v[i][j];
		}
		cout << endl;
	}

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

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

std::vector<std::vector<char>> turn_right(const std::vector<std::vector<char>> &vector) {
	std::vector<std::vector<char>> res(8, std::vector<char>(8));
	for (auto x = 0; x < 8; ++x) {
		for (auto y = 0; y < 8; ++y) {
			res.at(y).at(x) = vector.at(7 - x).at(y);
		}
	}
	return res;
}
int main() {
	std::vector<std::vector<char>> vector(8, std::vector<char>(8));
	for (auto i = 0; i < 8; ++i) {
		char arg[10];
		std::cin >> arg;
		for (auto j = 0; j < 8; ++j) {
			vector.at(i).at(j) = arg[j];
		}
	}
	for (auto i = 90; i <= 270; i += 90) {
		std::cout << i << '\n';
		vector = turn_right(vector);
		for (const auto &line : vector) {
			for (const auto &c : line) {
				std::cout << c;
			}
			std::cout << '\n';
		}
	}
}

C++: #include<iostream>
#define _USE_MATH_DEFINES
#include<math.h>
#include<iomanip>
#include<string>
using namespace std;
int main(){
string src[8];
for (int i=0;i<8;i++){
	cin>>src[i];
}

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


}

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

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