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, ""))
	}
}

Python: # AOJ 0133 Rotation of a Pattern
# Python3 2018.6.19 bal4u

a = [[[0 for c in range(8)] for r in range(8)] for k in range(4)]
title = ["0", "90", "180", "270"]

for r in range(8):
	a[0][r] = list(input())
for k in range(1, 4):
	print(title[k])
	for r in range(8):
		for c in range(8):
			a[k][c][7-r] = a[k-1][r][c]
	for r in range(8): print(*a[k][r], sep='')

Python: def spin(p):
  ret = [[None] * 8 for _ in range(8)]
  for i in range(8):
    for j in range(8):
      ret[i][j] = p[7 - j][i]
  return ret

def print_p(p):
  for line in p:
    print("".join(line))

p = [input() for _ in range(8)]

print(90)
p = spin(p)
print_p(p)

print(180)
p = spin(p)
print_p(p)

print(270)
p = spin(p)
print_p(p)

Python: from __future__ import print_function
from copy import deepcopy

try:
    xrange
except NameError:
    pass
else:
    range = xrange

def rotate(array):
    array2 = deepcopy(array)
    for i in range(8):
        for j in range(8):
            array2[j][7 - i] = array[i][j]
    return array2

def to_str(array):
    return '\n'.join(map(''.join, array))

def solve(lines):
    lines90 = rotate(lines)
    print(90)
    print(to_str(lines90))
    
    lines180 = rotate(lines90)
    print(180)
    print(to_str(lines180))
    
    lines270 = rotate(lines180)
    print(270)
    print(to_str(lines270))

if __name__ == '__main__':
    lines = []
    for _ in range(8):
        lines.append(list(raw_input().strip()))
    solve(lines)

Python: def spin(pazzule):
    pzl = [["" for i in range(8)] for j in range(8)]
    for i in range(8):
        for j in range(8):
            pzl[i][j] = pazzule[7-j][i]
    return pzl
    
pazzule = [list(input()) for i in range(8)]
pazzule = spin(pazzule)
print("90")
for i in range(8):
    print("".join(pazzule[i]))
print("180")
pazzule = spin(pazzule)
for i in range(8):
    print("".join(pazzule[i]))
print("270")
pazzule = spin(pazzule)
for i in range(8):
    print("".join(pazzule[i]))

Python: #写経させていただきました。
def spin(p):
    ret = [[None] * 8 for _ in range(8)]
    for i in range(8):
        for j in range(8):
            ret[i][j] = p[7 - j][i]
    return ret

def print_p(p):
    for line in p:
        print("".join(line))

p = [input() for _ in range(8)]

print(90)
p = spin(p)
print_p(p)

print(180)
p = spin(p)
print_p(p)

print(270)
p = spin(p)
print_p(p)

Python: from __future__ import print_function
from copy import deepcopy

try:
    xrange
except NameError:
    pass
else:
    range = xrange

def solve(lines):
    lines90 = deepcopy(lines)
    for i in range(8):
        for j in range(8):
            lines90[j][7 - i] = lines[i][j]
    print(90)
    print('\n'.join(map(''.join, lines90)))
    
    lines180 = deepcopy(lines)
    for i in range(8):
        for j in range(8):
            lines180[j][7 - i] = lines90[i][j]
    print(180)
    print('\n'.join(map(''.join, lines180)))
    
    lines270 = deepcopy(lines)
    for i in range(8):
        for j in range(8):
            lines270[j][7 - i] = lines180[i][j]
    print(27)
    print('\n'.join(map(''.join, lines270)))

if __name__ == '__main__':
    lines = []
    for _ in range(8):
        lines.append(list(raw_input().strip()))
    solve(lines)

Python: 
MAX=8
L = [ [None] * MAX for x in range(MAX) ]

for i in range(MAX):
    l = list(input())
    L[i] = l

T = [ [None] * MAX for x in range(MAX) ]

for r in range(1,4):
    print(r*90)
    for i in range(MAX):
        for j in range(MAX):
            T[i][j] = L[MAX-1-j][i]

    L = T
    T = [ [None] * MAX for x in range(MAX) ]
    for l in L:
        print("".join(l))

Python: t = []

for i in range(8):
    t.append(input())
    
print(90)
for i in range(8):
    for j in range(8):
        print(t[7-j][i],end="")
    print("")

print(180)
for i in range(8):
    for j in range(8):
        print(t[7-i][7-j],end="")
    print("")

print(270)
for i in range(8):
    for j in range(8):
        print(t[j][7-i],end="")
    print("")

Python: def rotate(k, p):
    q=[]
    print('90' if k==1 else('180' if k==2 else '270'))
    for i in range(8):
        t=''
        for j in range(8)[::-1]:
            print(p[j][i], end='')
            t+=p[j][i]
        q.append(t)
        print()
    return q

p= [input() for _ in range(8)]
for i in range(1, 4):
    p= rotate(i, p)

Python: def Draw(pattern, rowRange, colRange):
    
    s = ""

    for row in rowRange:
        for col in colRange:
            s += pattern[row][col]
        s += "\n"

    print(s, end="")


pattern = [input() for lp in range(8)]

print("90")
Draw(pattern, range(7, -1, -1), range(0, 8))

print("180")
Draw(pattern, range(7, -1, -1), range(7, -1, -1))

print("270")
Draw(pattern, range(0, 8), range(7, -1, -1))

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0133

"""
import sys
from sys import stdin
input = stdin.readline


def rotate_ccw(data):
    A = [[''] * 8 for _ in range(8)]
    for i in range(8):
        for j in range(8):
            A[i][j] = data[j][7-i]

    for l in A:
        print(''.join(l))
    return A


def rotate_cw(data):
    A = [[''] * 8 for _ in range(8)]
    for i in range(8):
        for j in range(8):
            A[i][j] = data[7-j][i]

    for l in A:
        print(''.join(l))
    return A


def main(args):
    data = []
    for _ in range(8):
        data.append(list(input().strip()))

    print('90')
    data = rotate_cw(data)
    print('180')
    data = rotate_cw(data)
    print('270')
    data = rotate_cw(data)


if __name__ == '__main__':
    main(sys.argv[1:])

Python: mat = []
for _ in range(8):
    mat.append(list(input()))

mat90 = [[0 for i in range(8)] for j in range(8)]
print(90)
for i in range(8):
    for j in range(8):
        mat90[i][j] = mat[7-j][i]

for i in range(8):
    print(''.join(m for m in mat90[i]))

mat180 = [[0 for i in range(8)] for j in range(8)]
print(180)
for i in range(8):
    for j in range(8):
        mat180[i][j] = mat90[7-j][i]

for i in range(8):
    print(''.join(m for m in mat180[i]))

mat270 = [[0 for i in range(8)] for j in range(8)]
print(270)
for i in range(8):
    for j in range(8):
        mat270[i][j] = mat180[7-j][i]

for i in range(8):
    print(''.join(m for m in mat270[i]))

Python: m=[input() for _ in range(8)]
for i in [90,180,270]:
    m=list(zip(*m[::-1]))
    print(i)
    for x in m:
        print(''.join(x))

Python: m=[input() for _ in range(8)]
for i in range(3):
    m=list(zip(*m[::-1]))
    print(90*(i+1))
    for x in m:
        print(''.join(x))

Python: def rotate(m,n):
    print(90*n)
    for i in range(8):
        print(''.join(m[i]),end='')
        print()

m=[input() for _ in range(8)]
for i in range(3):
    m=list(zip(*m[::-1]))
    rotate(m,i+1)

Python: m=[input() for _ in range(8)]
print(90)
a=-1
for j in range(8):
    for i in range(7,a,a):
        print(m[i][j],end='')
    print()
print(180)
for i in range(7,a,a):
    for j in range(7,a,a):
        print(m[i][j],end='')
    print()
print(270)
for j in range(7,a,a):
    for i in range(8):
        print(m[i][j],end='')
    print()