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>

using namespace std;

char inp[10][10];

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

    cout << "90" << endl;
    for (int i = 7; i >= 0; i--)
        cout << inp[i] << endl;

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

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

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<string>
using namespace std;
int main(){
    char s[10][10];
    for(int i=0;i<8;i++)cin>>s[i];

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


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

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

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

char a[2][9][9];

void rotate(int f) {
  for (int i=0; i<8; i++) {
    for (int j=0; j<8; j++) {
      a[(f+1)&1][i][j] = a[f&1][7-j][i];
    }
  }
}

int main() {
  for (int i=0; i<8; i++) {
    scanf("%s", a[0][i]);
  }
  for (int i=0; i<3; i++) {
    rotate(i);
    printf("%d\n", 90*(i+1));
    for (int j=0; j<8; j++) {
      printf("%s\n", a[(i+1)&1][j]);
    }
  }
  return 0;
}

C++: #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
int main(){
  string s[8];
  for(int i=0;i<8;i++)cin>>s[i];
  cout<<90<<endl;
  for(int i=0;i<8;i++){
    for(int j=7;j>=0;j--){
      cout<<s[j][i];
    }
    cout<<endl;
  }
  cout<<180<<endl;
  for(int i=7;i>=0;i--){
    for(int j=7;j>=0;j--){
      cout<<s[i][j];
    }
    cout<<endl;
  }
  cout<<270<<endl;
  for(int i=0;i<8;i++){
    for(int j=7;j>=0;j--){
      cout<<s[i][j];
    }
    cout<<endl;
  }
}

C++: #include <iostream>

using namespace std;

int main() {

  char map[8][8];

  char temp[8][8];


  for(int i=0;i<8;i++) {

    cin >> map[i];

  }

  //90ツ度ツ嘉アツ転
  for(int i=0;i<8;i++) for(int j=0;j<8;j++) temp[i][j]=map[7-j][i];

  cout << "90" << endl;

  for(int i=0;i<8;i++) {

    for(int j=0;j<8;j++) {

      cout << temp[i][j];

    }

    cout << endl;

  }

  //180ツ度ツ嘉アツ転
  for(int i=0;i<8;i++) for(int j=0;j<8;j++) temp[i][j]=map[7-i][7-j];

  cout << "180" << endl;

  for(int i=0;i<8;i++) {

    for(int j=0;j<8;j++) {

      cout << temp[i][j];

    }

    cout << endl;

  }

   //270ツ度ツ嘉アツ転
  for(int i=0;i<8;i++) for(int j=0;j<8;j++) temp[i][j]=map[j][7-i];

  cout << "270" << endl;

  for(int i=0;i<8;i++) {

    for(int j=0;j<8;j++) {

      cout << temp[i][j];

    }

    cout << endl;

  }
  return 0;

}

C++: #include <bits/stdc++.h>

typedef long long ll;
using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	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;

}

C++: #include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
  string s[8];
  r(i,8)cin>>s[i];
  cout<<90<<endl;
  r(i,8){r(j,8)cout<<s[7-j][i];cout<<endl;}
  cout<<180<<endl;
  r(i,8){r(j,8)cout<<s[7-i][7-j];cout<<endl;}
  cout<<270<<endl;
  r(i,8){r(j,8)cout<<s[j][7-i];cout<<endl;}
}

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

int main(){
	int angle = 90;
	char a[8][8],b[8][8],c[8][8],d[8][8];
	for(int i = 0;i < 8;++i){
		for(int j = 0;j < 8;++j){
			cin >> a[i][j];
		}
	}
	for(int i = 0;i < 8;++i){
		for(int j = 0;j < 8;++j){
			b[i][j] = a[7 - j][i];
		}
	}
	cout << angle << endl;
	for(int i = 0;i < 8;++i){
		for(int j = 0;j < 8;++j){
			cout << b[i][j];
		}
		cout << endl;
	}
	for(int i = 0;i < 8;++i){
		for(int j = 0;j < 8;++j){
			c[i][j] = b[7 - j][i];
		}
	}
	cout << angle * 2 << endl;
	for(int i = 0;i < 8;++i){
		for(int j = 0;j < 8;++j){
			cout << c[i][j];
		}
		cout << endl;
	}
	for(int i = 0;i < 8;++i){
		for(int j = 0;j < 8;++j){
			d[i][j] = c[7 - j][i];
		}
	}
	cout << angle * 3 << endl;
	for(int i = 0;i < 8;++i){
		for(int j = 0;j < 8;++j){
			cout << d[i][j];
		}
		cout << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

char inp[10][10];

void rotate()
{
    char tmp[10][10];

    for (int i = 0; i < 8; i++)
        for (int j = 0; j < 8; j++)
            tmp[i][j] = inp[i][j];

    for (int i = 0; i < 8; i++)
        for (int j = 0; j < 8; j++)
            inp[i][j] = tmp[7 - j][i];
}

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

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

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

int main()
{
  vector<string> pattern(8), ans(8);
  for (int i = 0; i < 8; ++i) {
    cin >> pattern[i];
    ans[i] = pattern[i];
  }

  for (int r = 90; r <= 270; r += 90) {
    for (int i = 0; i < 8; ++i) {
      for (int j = 0; j < 8; ++j) 
	ans[j][7-i] = pattern[i][j];
    }

    cout << r << endl;
    for (int i = 0; i < 8; ++i)
      cout << ans[i] << endl;
    pattern = ans;
  }

  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;
  for(int i = N - 1; i >= 0; --i){
    REP(j, N) cout <<v[i][j];
    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;
  REP(i, N){
    for(int j = N - 1; j >= 0; --j) cout <<v[i][j];
    cout <<endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
  string s[8];
  r(i,8)cin>>s[i];
  cout<<90<<endl;
  r(i,8){r(j,8)cout<<s[7-i][j];cout<<endl;}
  cout<<180<<endl;
  r(i,8){r(j,8)cout<<s[7-i][7-j];cout<<endl;}
  cout<<270<<endl;
  r(i,8){r(j,8)cout<<s[i][7-j];cout<<endl;}
}