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 <stdio.h>
#include <string.h>
using namespace std;

int main() {
	int a,i,j,k,x,y;
	char ch[8][9],an[8][9];
	for (i=0;i<8;i++) gets(ch[i]);
	for (i=1;i<4;i++) {
		 for (y=0;y<8;y++) for(x=0;x<8;x++) an[x][7-y]=ch[y][x];
	   	 for (j=0;j<8;j++) for (k=0;k<8;k++) ch[j][k]=an[j][k];
		 cout << i*90 << endl; 
		 for (k=0;k<8;k++) cout << ch[k] << endl;
	}
 return 0;
}

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  char c[8][8];
  rep(i,8){
    rep(j,8){
      cin >> c[j][i];
    }
  }
  cout << 90 <<endl;
  rep(i,8){
    rep(j,8){
      cout << c[j][7-i];
    }
    cout << endl;
  }
  cout << 180 <<endl;
  rep(i,8){
    rep(j,8){
      cout << c[7-j][7-i];
    }
    cout << endl;
  }
  cout << 270 <<endl;
  rep(i,8){
    rep(j,8){
      cout << c[7-j][i];
    }
    cout << endl;
  }
  return 0;
}

C++: #include<stdio.h>
char c[8][9];
int main(){
	for(int i=0;i<8;i++)scanf("%s",c[i]);
	printf("90\n");
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			printf("%c",c[8-j-1][i]);
		}
		printf("\n");
	}
	printf("180\n");
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			printf("%c",c[8-i-1][8-j-1]);
		}
		printf("\n");
	}
	printf("270\n");
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			printf("%c",c[j][8-i-1]);
		}
		printf("\n");
	}
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

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

C++: #include<iostream>
#include<string>
int i,j;main(){std::string s[8],t;for(;i<8;)getline(std::cin,s[i++]);for(t="90\n";i-->0;t+="\n")for(j=8;j-->0;)t+=s[j][7-i];for(t+="180\n";++i<8;t+="\n")for(j=8;j-->0;)t+=s[7-i][j];for(t+="270\n";i-->0;t+="\n")for(j=0;j<8;)t+=s[j++][i];std::cout<<t;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,temp2;
	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)
	{
		string t = "";
		for(int j=7;j>=0;j--)
		{
			t += temp[j][i];
			cout << temp[j][i];
		}
		temp2.push_back(t);
		cout << endl;
	}

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

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[j][i];
		}
		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<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;
#define int long long

signed 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 <stdio.h>
#include <string.h>

int rote(int map[][8])
{
	int tmp[8][8];
	
	
	for (int i = 0; i < 8 ; i++){
		for (int j = 0; j < 8; j++){
			tmp[j][i] = map[j][i];
		}
	}
	
	for (int i = 0; i < 8 ; i++){
		for (int j = 0; j < 8; j++){
			map[j][i] = tmp[i][8 - j - 1];
		}
	}
	
	return (0);
}


int main(void)
{
	int map[8][8];
	char in[9];
	
	for (int y = 0; y < 8; y++){
		scanf("%s", in);
		for (int x = 0; x < 8; x++){
			map[x][y] = in[x];
		}
	}
	
	for (int i = 0; i < 3; i++){
		rote(map);
		printf("%d\n", 90 * (i + 1));
		for (int y = 0; y < 8; y++){
			for (int x = 0; x < 8; x++){
				printf("%c", map[x][y]);
			}
			puts("");
		}
	}
	
	return (0);
}

C++: #include <iostream>

using namespace std;
char field[8][8];

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

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