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<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#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 all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	char c[8][8];
	rep(i, 0, 8)rep(j, 0, 8)cin >> c[i][j];
	cout << 90 << endl;	rep(i, 0, 8) { rrep(j, 0, 8)cout << c[j][i]; cout << endl; }
	cout << 180 << endl; rrep(i, 0, 8) { rrep(j, 0, 8)cout << c[i][j]; cout << endl; }
	cout << 270 << endl; rrep(i, 0, 8) { rep(j, 0, 8)cout << c[j][i]; cout << endl; }
	return 0;
}

C++: #include <iostream>
#include <cstring>
int main(){
	char map[8][8],t_m[8][8];
	for(int i=0;i<8;i++){
		std::cin >> map[i];
	}

	for(int i=1;i<4;i++){
		//ツ角ツ度ツ閉ェ(ツ９ツ０ツ，ツ１ツ８ツ０ツ，ツ２ツ７ツ０)ツ嘉アツ転ツつオツつスツ配ツ療アツづーツ催ャツづゥ
		for(int y=0;y<8;y++){
			for(int x=0;x<8;x++){
				t_m[x][7-y] = map[y][x];
			}
		}

		memcpy(map,t_m,sizeof(t_m));

		std::cout << 90 * i << std::endl;
		for(int y=0;y<8;y++){
			for(int x=0;x<8;x++){
				std::cout << map[y][x];
			}
			std::cout << "\n";
		}
	}
}

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};

int main(){
	char board[10][10];
	rep(i, 8)rep(j, 8){
		cin>>board[i][j];
	}
	for(int i =90;i <=270;i+=90){
		char tmp[10][10];
		cout <<i<<endl;
		for(int j = 0;j <8;j++){
			for(int k = 0;k <8;k++){
				tmp[j][k]=board[7-k][j];
			}
		}
		rep(j,8){
			rep(k,8){
				cout <<tmp[j][k];
			}
			cout <<endl;
		}
		rep(j, 8)rep(k, 8)board[j][k]=tmp[j][k];

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

int func1( int n )
{
	return n;
}

int func2( int n )
{
	return 7 - n;
}

void output( char map[][ 8 ], int dir )
{
	int angle = dir * 90;
	int i, j;
	int *p1, *p2;
	int (*f1)(int), (*f2)(int);
	switch( dir ){
		case 1: f1 = &func2; f2 = &func1; p1 = &j; p2 = &i; break;
		case 2: f1 = &func2; f2 = &func2; p1 = &i; p2 = &j; break;
		case 3: f1 = &func1; f2 = &func2; p1 = &j; p2 = &i; break;

	}

	cout << angle << endl;
	for( i = 0; i < 8; ++i ){
		for( j = 0; j < 8; ++j ){
			cout << map[ f1( *p1 ) ][ f2( *p2 ) ];
		}
		cout << endl;
	}
}

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

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

	output( map, 1 );
	output( map, 2 );
	output( map, 3 );

	return 0;
}

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

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

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

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

int main(void){
  vector<string> grid(8);
  REP(i,8)cin>>grid[i];
  cout<<90<<endl;
  REP(y,8){
    REP(x,8){
      cout<<grid[7-x][y];
    }
    cout<<endl;
  }
  cout<<180<<endl;
  REP(y,8){
    REP(x,8){
      cout<<grid[7-y][7-x];
    }
    cout<<endl;
  }
  cout<<270<<endl;
  REP(y,8){
    REP(x,8){
      cout<<grid[x][7-y];
    }
    cout<<endl;
  } 
  return 0;
}

C++: #include<iostream>

using namespace std;

//入力文字列
char str_input[8][9];
int h_do[3] = {90 , 180 , 270};

//横向きに
void f_yoko();

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

	for (int i = 0; i < 3; i++)
	{
		f_yoko();

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

	return 0;
}






//横向きに
void f_yoko()
{
	//交換文字列
	char str_change[8][9] = {NULL};

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

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

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[j][7-k];

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

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