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++: # define _CRT_SECURE_NO_WARNINGS 1
# include <iostream>
# include <numeric>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include <list>
# include <functional>
# include <string>
# include <ctime>
# include <set>
# include <map>
# include <stack>
using namespace std;
//# define M_PI 3.141592
# define INF ((int)(1<<30))
# define FOR(i,n) for(int i=0;i<(int)n;i++)
# define FORI(i,k,n) for(int i=k;i<(int)n;i++)
# define toRad 2.0*M_PI/360.0
# define inin(x) int x;cin>>x;
# define all(x) x.begin(),x.end()
# define debug(x) cout<<#x<<" :"<<x<<endl;
# define rep(i,n) for(int i=0;i<(int)n;i++)
# define EPS 1e-12
# define CHECK(i,a) FOR(i,a.size())cout<<#a<<"["<<i<<"] : "<<a[i]<<endl; 

class Point
{
public:
	double x, y;

	Point(double x = 0, double y = 0) :x(x), y(y) {}


	Point operator + (Point p) { return Point(x + p.x, y + p.y); }
	Point operator - (Point p) { return Point(x - p.x, y - p.y); }
	Point operator * (double k) { return Point(x * k, y * k); }
	Point operator / (double k) { return Point(x / k, y / k); }
	bool operator < (const Point &p)const { return x != p.x ? x < p.x : y < p.y; }
	bool operator ==(const Point &p)const { return fabs(x - p.x) < EPS&&fabs(y - p.y) < EPS; }

	double abs() { return sqrt(norm()); }
	double norm() { return x*x + y*y; }
};
typedef Point Vector;
struct Segment
{
	Point p1, p2;
};
typedef Segment Line;
class Circle
{
public:
	Point c;
	double r;
	Circle(Point c = Point(), double r = 0.0) :c(c), r(r) {}
};

double dot(Vector a, Vector b) { return a.x*b.x + a.y*b.y; }//??????
double cross(Vector a, Vector b) { return a.x*b.y - a.y*b.x; }//??????
bool isOrthogonal(Vector a, Vector b) { return fabs(dot(a, b)) < EPS; }//??´??????
bool isOrthogonal(Point a1, Point a2, Point b1, Point b2) { return isOrthogonal(a1 - a2, b1 - b2); }
bool isOrthogonal(Line l1, Line l2) { return fabs(dot(l1.p2 - l1.p1, l2.p2 - l2.p1)) < EPS; }
bool isParallel(Vector a, Vector b) { return fabs(cross(a, b)) < EPS; }//?????????
bool isParallel(Point a1, Point a2, Point b1, Point b2) { return isParallel(a1 - a2, b1 - b2); }
bool isParallel(Line l1, Line l2) { return fabs(cross(l1.p2 - l1.p1, l2.p2 - l2.p1)) < EPS; }
Point project(Line s, Point p)
{
	Vector base = s.p2 - s.p1;
	double r = dot(p - s.p1, base) / base.norm();
	return s.p1 + base*r;
}


int dx[5] = { 0,-1,0,1,0 }, dy[5] = { 1,0,0,0,-1 };
bool check(int a[12][12])
{
	int t = 0;
	for (int i = 1; i <= 10; i++)for (int j = 1; j <= 10; j++)t += a[i][j];
	return t == 0;
}
void paint(int f[12][12], int x, int y)
{
	for (int k = 0; k < 5; k++)
	{
		f[x + dx[k]][y + dy[k]]++;
		f[x + dx[k]][y + dy[k]] %= 2;
	}
}
int main()
{
	string a[8];
	for (int i = 0; i < 8; i++)cin >> a[i];
	for (int i = 1; i <= 3; i++)
	{
		string temp[8];
		for (int i = 0; i < 8; i++)
		{
			temp[i] = a[i];
			a[i].clear();
		}
		for (int i = 0; i < 8; i++)
		{
			for (int j = 7; j >= 0; j--)
			{
				a[i] += temp[j][i];
			}
		}
		cout << i * 90 << endl;
		for (int i = 0; i < 8;i++)cout<<a[i]<<endl;

	}
}

C++: #include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

vvc field(8,vc(8));

int main(){
	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;
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <sstream>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

char pat[8][8];
char rot[8][8];

main(){
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			cin>>pat[i][j];
		}
	}
	
	for(int i=1;i<=3;i++){
		cout<<i*90<<endl;
		for(int j=0;j<8;j++){
			for(int k=0;k<8;k++){
				rot[j][k]=pat[7-k][j];
				cout<<rot[j][k];
			}
			cout<<endl;
		}
		cout<<endl;
		memcpy(pat,rot,sizeof(rot));
	}
}

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

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

char field[10][10];
char tmp[10][10];

void rotate(){
	for(int i=0; i < 8; i++){
		for(int j=0; j < 8; j++){
			tmp[i][j] = field[i][j];
		}
	}

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

void output(){
	for(int i=0; i < 8; i++){
		for(int j=0; j < 8; j++){
			cout << field[i][j];
		}
		cout << endl;
	}
}

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


	cout << 90 << endl;
	rotate();
	output();

	cout << 180 << endl;
	rotate();
	output();

	cout << 270 << endl;
	rotate();
	output();
}

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

int main(){
	char f[8][9];
	
	for(int i=0; i<8; ++i)
		scanf(" %s", f[i]);
		
	printf("90\n");
	for(int i=0; i<8; ++i){
		for(int j=0; j<8; ++j){
			printf("%c", f[7-j][i]);	
		}
		printf("\n");
	}
	
	printf("180\n");
	for(int i=0; i<8; ++i){
		for(int j=0; j<8; ++j){
			printf("%c", f[7-i][7-j]);	
		}
		printf("\n");
	}
	
	printf("270\n");
	for(int i=0; i<8; ++i){
		for(int j=0; j<8; ++j){
			printf("%c", f[j][7-i]);	
		}
		printf("\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<8;i++){
		for(int j=0;j<8;j++){
			cout<<s[i][7-j];
		}
		cout<<endl;
	}
	
	return 0;
}