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 <string>
#include <algorithm>
using namespace std;

int main(){
	int angle = 90;
	string s[8];
	for(int i = 0;i < 8;++i){
		cin >> s[i];
	}
	swap(s[0],s[7]);
	cout << angle << endl;
	for(int i = 0;i < 8;++i){
		cout << s[i] << endl;
	}
	for(int i = 0;i < 8;++i){
		swap(s[i][0],s[i][7]);
	}
	cout << angle * 2 << endl;
	for(int i = 0;i < 8;++i){
		cout << s[i] << endl;
	}
	swap(s[0],s[7]);
	cout << angle * 3 << endl;
	for(int i = 0;i < 8;++i){
		cout << s[i] << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>

using namespace std;

char pattern[8][8];

void rotate_270() {
    printf("270\n");
    for (int i = 7; i >= 0; i--) {
        for (int j = 0; j < 8; j++) {
            putchar(pattern[j][i]);
        }
        putchar('\n');
    }
}

void rotate_180() {
    printf("180\n");
    for (int i = 7; i >= 0; i--) {
        for (int j = 7; j >= 0; j--) {
            putchar(pattern[i][j]);
        }
        putchar('\n');
    }
}

void rotate_90() {
    printf("90\n");
    for (int i = 0; i < 8; i++) {
        for (int j = 7; j >= 0; j--) {
            putchar(pattern[j][i]);
        }
        putchar('\n');
    }
}

int main() {
    for (int i = 0; i < 8; i++) {
        for (int j = 0; j < 8; j++) {
            pattern[i][j] = getchar();
        }
        getchar();
    }
//    for (int i = 0; i < 8; i++) {
//        for (int j = 0; j < 8; j++) {
//            cout << pattern[i][j];
//        }
//        cout << endl;
//    }
    rotate_90();
    rotate_180();
    rotate_270();
    return 0;
}