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;


int main(void)
{
	//入力文字列
	char str_input[8][9] = {NULL};

	//出力配列
	int h_outint[3] = {90 , 180 , 270};

	//よくわからないので出力用
	char str_output[3][8][9] = {NULL};

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

	//カウント変数
	int count1 = 0;

	for (int i = 0; i < 8; i++)
	{
		int count2 = 0;
		for (int j = 7; j >= 0; j--)
		{
			//cout << str_input[j][i];
			str_output[0][count1][count2++] = str_input[j][i];
		}
		count1++;
		//cout << endl;
	}

	count1 = 0;
	for (int i = 7; i >= 0; i--)
	{
		int count2 = 0;
		for (int j = 7; j >= 0; j--)
		{
			//cout << str_input[i][j];
			str_output[1][count1][count2++] = str_input[i][j];
		}
		count1++;
		//cout << endl;
	}

	count1 = 0;
	for (int i = 7; i >= 0; i--)
	{
		int count2 = 0;
		for (int j = 0; j < 8; j++)
		{
			//cout << str_input[j][i];
			str_output[2][count1][count2++] = str_input[j][i];
		}
		count1++;
		//cout << endl;
	}

	for (int i = 0; i < 3; i++)
	{
		//出力
		cout << h_outint[i] << endl;
		for (int j = 0; j < 8; j++)
		{
			cout << str_output[i][j] << endl;
		}
	}

	return 0;
}

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

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

using namespace std;

int main()
{
	string s[8];
	vector<string> temp;
	rep(i,8)
	{
		cin >> s[i];
	}
	cout << 90 << endl;
	rep(i,8)
	{
		string t = "";
		for(int j=7;j>=0;j--)
		{
			t += s[j][i];
			cout << s[j][i];
		}
		temp.push_back(t);
		cout << endl;
	}

	cout << 180 << endl;
	rep(i,8)
	{
		rep(j,8)
		{
			cout << s[j][i];
		}
		cout << endl;
	}

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

	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <fstream>
#include <sstream>
#include <math.h>
#include <queue>
#include <stack>
#include <math.h>
#include <string.h>


using namespace std;


void rotation_of_Pattern_90(int l, int r, int pattern[100][100], int ans[100][100]){
    for(int i=l; i<r; i++){
        for(int j=l; j<r; j++){
            ans[j][r-i-1]=pattern[i][j];
        }
    }
}


int main(){
    int box[100][100];
    for(int i=0; i<8; i++){
        for(int j=0; j<8; j++){
            char temp;
            cin>>temp;
            box[i][j]=(int)temp;
            
        }
    }
    /*
    for(int i=0; i<8; i++){
        for(int j=0; j<8; j++){
            cout<<(char)box[i][j];
        }cout<<endl;
    }
     */
    
    cout<<90<<endl;
    int ans[100][100];
    rotation_of_Pattern_90(0, 8, box, ans);
    for(int i=0; i<8; i++){
        for(int j=0; j<8; j++){
            cout<<(char)ans[i][j];
        }cout<<endl;
    }
    
    
    cout<<180<<endl;
    int ans2[100][100];
    rotation_of_Pattern_90(0, 8, ans, ans2);
    for(int i=0; i<8; i++){
        for(int j=0; j<8; j++){
            cout<<(char)ans2[i][j];
        }cout<<endl;
    }
    
    cout<<270<<endl;
    int ans3[100][100];
    rotation_of_Pattern_90(0, 8, ans2, ans3);
    for(int i=0; i<8; i++){
        for(int j=0; j<8; j++){
            cout<<(char)ans3[i][j];
        }cout<<endl;
    }
    
    
    
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());


int main(){
	vector<string> v(8);
	rep(i,8){
		cin>>v[i];
	}
	cout<<90<<endl;
	rep(i,8){
		rep(j,8){
			cout<<v[7-j][i];
		}
		cout<<endl;
	}
	cout<<180<<endl;
	rep(i,8){
		rep(j,8){
			cout<<v[7-i][7-j];
		}
		cout<<endl;
	}
	cout<<270<<endl;
	rep(i,8){
		rep(j,8){
			cout<<v[j][7-i];
		}
		cout<<endl;
	}
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
#include<functional>
using namespace std;

int main(){
	int N,V,sum=0;
	cin>>N;
	for(int i=0;i<N;i++) cin>>V, sum += V;
	printf("%d\n",sum/N);
	return 0;
}

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

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

C++: #include<cstdio>

using namespace std;

int main()
{
	char pttn[8][9];

	for(int i=0;i<8;i++)	scanf("%s",pttn+i);

	puts("90");
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++)	putchar(pttn[7-j][i]);
		puts("");
	}
	puts("180");
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++)	putchar(pttn[7-i][7-j]);
		puts("");
	}
	puts("270");
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++)	putchar(pttn[j][7-i]);
		puts("");
	}

	return 0;
}

C++: #include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define itrep(it, a) for(it = (a).begin(); it != (a).end(); it++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
#define INF (1 << 30)
using namespace std;

int main(){
    char a[8][8];
    rep(i,8) rep(j,8) cin >> a[i][j];

    cout << 90 << endl;
    rep(i,8){
        for(int j = 7; j >= 0; j--){
            cout << a[j][i];
        }cout << endl;
    }
    cout << 180 << endl;
    for(int i = 7; i >= 0; i--){
        for(int j = 7; j >= 0; j--){
            cout << a[i][j];
        }cout << endl;
    }
    cout << 270 << endl;
    for(int i = 7; i >= 0; i--){
        rep(j,8){
            cout << a[j][i];
        }cout << endl;
    }

}

C++: #include <iostream>
#include <cstring>
using namespace std;
char p[8][9];
void rotate()
{
	int i;
	char tmp[8][9];
	for (i = 0; i < 8; i++)
		strcpy(tmp[i], p[i]);
	for (int x = 7; x >= 0; x--)
		for (int y = 0; y < 8; y++)
			tmp[y][x] = p[7-x][y];
	for (i = 0; i < 8; i++)
	{
		strcpy(p[i], tmp[i]);
		cout << p[i] << endl;
	}
}
int main()
{
	int i;
	for (i = 0; i < 8; i++)
		cin >> p[i];
	for (i = 1; i <= 3; i++)
	{
		cout << 90*i << endl;
		rotate();
	}
}