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<bits/stdc++.h>
using namespace std;

char data[9][9];
char out[9][9]; //出力用

void rotation90(){

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

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

}

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

  for(int i=1; i<4; i++) {
    cout<< 90*i<< endl;
    rotation90();
  }

}

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

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


typedef long long ll;
const double Eps = 1e-5;

using namespace std;

int main()
{
	char pat[8][9];
	for (int i = 0; i < 8; ++i)
		cin.getline(pat[i], sizeof(pat[i]));
	for (int rotate = 1; rotate <= 3; ++rotate)
	{
		char copy[8][9];
		memcpy(copy, pat, sizeof(copy));
		for (int i = 0; i < 8; ++i)
		{
			for (int j = 0; j < 8; ++j)
			{
				int x = j < 4 ? j-4 : j-3;
				int y = i < 4 ? i-4 : i-3;
				int dx = -y;
				int dy = x;
				int dj = dx < 0 ? dx+4 : dx+3;
				int di = dy < 0 ? dy+4 : dy+3;
				copy[di][dj] = pat[i][j];
			}
		}
		memcpy(pat, copy, sizeof(pat));

		printf("%d\n", rotate*90);
		for (int i = 0; i < 8; ++i)
			puts(pat[i]);
	}

	return 0;
}

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

string s[8];

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

int main(){
	for(int i = 0;i < 8;i++) cin >> s[i];
	for(int i = 1;i <= 3;i++){
		cout << i * 90 << endl;
		rotate();
		for(int j = 0;j < 8;j++){
			cout << s[j] << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; ++i)
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define P pair<int, int>
const int N = 8;

int main() {
  vector<string> v(N);
  REP(i, N) cin >>v[i];
  cout <<"90" <<endl;
  REP(i, N){
    for(int j = N - 1; j >= 0; --j) cout <<v[j][i];
    cout <<endl;
  }
  cout <<"180" <<endl;
  for(int i = N - 1; i >= 0; --i){
    for(int j = N - 1; j >= 0; --j) cout <<v[i][j];
    cout <<endl;
  }
  cout <<"270" <<endl;
  for(int i = N - 1; i >= 0; --i){
    REP(j, N) cout <<v[j][i];
    cout <<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <vector>
#include <queue>

using namespace std;



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

C++: #include <iostream>

using namespace std;

#define rep(i,n) for(int i = 0 ; i < n ; i++)

int main(){
  char a[8][8],b[8][8];

  rep(i,8){
    rep(j,8){
      cin >> a[i][j];
    }
  }

  rep(k,3){
    cout << (k+1)*90 << endl;
    rep(i,8){
      rep(j,8){
	cout << a[7-j][i];
	b[i][j] = a[7-j][i];
      }
      cout << endl;
    }
    
    rep(i,8){
      rep(j,8){
	a[i][j] = b[i][j];
      }
    }
  }

  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
char fie[11][11];

void rotate(){
char buf[11][11];
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
buf[j][i] = fie[i][7-j];
}
}
for(int i=0;i<8;i++)
for(int j=0;j<8;j++)
fie[j][i] = buf[j][i];
}

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

int main(){

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

rotate();
cout << 90 << endl;
view();
rotate();
cout << 180 << endl;
view();
rotate();
cout << 270 << endl;
view();

}

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

using namespace std;

void rotate(vector<string> &v){
	vector<string> nv(8,"");
	for(int i = 0; i < 8; i++){
		for(int j = 0; j < 8; j++){
			nv[i]+=v[7-j][i];
		}
	}
	v=nv;
}

int main(){

	vector<string> v;
	for(int i = 0; i < 8; i++){
		string s;
		cin>>s;
		v.push_back(s);
	}
	int sum=0;
	for(int i = 0; i < 3; i++){
		sum+=90;
		rotate(v);
		cout<<sum<<endl;
		for(int i = 0; i < 8; i++)
			cout<<v[i]<<endl;
	}

	return 0;
}

C++: #include<iostream>

void rotate(char ptn[8][8]);

int main()
{
	char pattern[8][8];
	char buf[10];
	for(int i=0;i<8;i++)
	{
		std::cin.getline(buf,10);
		for(int j=0;j<8;j++)
		{
			pattern[i][j]=buf[j];
		}
	}
	for(int i=1;i<=3;i++)
	{
		std::cout<<90*i<<std::endl;
		rotate(pattern);
		for(int j=0;j<8;j++)
		{
			for(int k=0;k<8;k++)
			{
				std::cout<<pattern[j][k];
			}
			std::cout<<std::endl;
		}
	}
	return 0;
}

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

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main(){
	char c[8][8];
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			cin>>c[i][j];
		}
	}

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

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

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

	return 0;
}