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 a[8][8];
int rx[]={ 1,-1,-1};
int ry[]={-1,-1, 1};
int dx[]={0,7,7};
int dy[]={7,7,0};

int main(){
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++)cin>>a[i][j];
	}
	for(int i=0;i<3;i++){
		cout<<(i+1)*90<<endl;
		for(int j=0;j<8;j++){
			for(int k=0;k<8;k++)cout<<a[j*ry[i]+dy[i]][k*rx[i]+dx[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<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;

void rotate90(char fld[8][8]){
	char fld_c[8][8]; memcpy(fld_c,fld,sizeof(fld_c));
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			fld[j][7-i] = fld_c[i][j];
		}
	}
}

int main(){
	char fld[8][8];
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			scanf(" %c",&fld[i][j]);
		}
	}
	for(int i=90;i<=270;i+=90){
		rotate90(fld);
		printf("%d\n",i);
		for(int j=0;j<8;j++){
			for(int k=0;k<8;k++){
				printf("%c",fld[j][k]);
			}puts("");
		}
	}
	return 0;
}

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


int main() {
  string g[8];
  for(int i = 0; i < 8; ++i) cin >> g[i];
  for(int k = 0; k < 3; ++k) {
    cout << (k+1)*90 << endl;
    string h[8];
    fill(h, h+8, string(8, ' '));
    for(int i = 0; i < 8; ++i) {
      for(int j = 0; j < 8; ++j) {
        h[i][j] = g[8-j-1][i];
      }
    }
    for(int i = 0; i < 8; ++i) {
      g[i] = h[i];
      cout << g[i] << endl;
    }
  }
}

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

using namespace std;

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;






int main() {
	string s[8];
	for (int i = 0; i < 8; i++) {
		cin >> s[i];
	}
	cout << "90" << endl;
	for (int j = 0; j < 8; j++) {
		for (int i = 7; i >= 0; i--) {
			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 j = 7; j >= 0; j--) {
		for (int i = 0; i < 8; i++) {
			cout << s[i][j];
		}
		cout << endl;
	}
}

C++: テ」ツ??include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    vector<string>v(8);
    rep(i,8)cin>>v[i];
    cout<<90<<endl;
    rep(j,8){rep(i,8)cout<<v[7-i][j]; cout<<endl;}
    cout<<180<<endl;
    rep(i,8){rep(j,8)cout<<v[7-i][7-j]; cout<<endl;}
    cout<<270<<endl;
    rep(j,8){rep(i,8)cout<<v[i][7-j]; cout<<endl;}
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

char s[8][9];
int main() {
	rep(i, 8)scanf("%s", s[i]);
	puts("90");
	for (int i = 7; i >= 0; i--) {
		rep(j, 8)cout << s[i][j];
		cout << endl;
	}
	puts("180");
	for (int i = 7; i >= 0; i--) {
		for (int j = 7; j >= 0; j--)cout << s[i][j];
		cout << endl;
	}
	puts("270");
	rep(i, 8){
		for (int j = 7; j >= 0; j--)cout << s[i][j];
		cout << endl;
	}
}

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 << "-------------" << endl;
	rep(i,8)
	{
		rep(j,8)
		{
			cout << temp[i][j];
		}
		cout << endl;
	}
	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<iostream>
using namespace std;

int x[8][8];
int y[8][8];
char c;

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

int main() {
	for (int i = 0; i < 8; i++) {
		for (int j = 0; j < 8; j++) {
			cin >> c;
			if (c == '#') { x[i][j] = 1; }
			else { x[i][j] = 0; }
		}
	}
	for (int i = 90; i <= 270; i += 90) {
		cout << i << endl;
		TheRotate90();
		for (int j = 0; j < 8; j++) {
			for (int k = 0; k < 8; k++) {
				x[j][k] = y[j][k];
				if (x[j][k] == 0) { cout << '*'; }
				else { cout << '#'; }
			}
			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=0;i<8;i++){
        for(int j=0;j<8;j++)cout<<s[j][i];
        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;
    }
}