Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	m500 := []float64{35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0, 1000.0}
	m1000 := []float64{71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0, 1000.0}
	classes := []string{"AAA", "AA", "A", "B", "C", "D", "E", "NA"}
	for scanner.Scan() {
		input := strings.Split(scanner.Text(), " ")
		t500, _ := strconv.ParseFloat(input[0], 64)
		t1000, _ := strconv.ParseFloat(input[1], 64)
		for i := 0; i < len(m500); i++ {
			if t500 < m500[i] && t1000 < m1000[i] {
				fmt.Println(classes[i])
				break
			}
		}
	}
}

C++: #include<iostream>
using namespace std;
int main(void){
  double f,t;
  while(cin >> f >> t){
    if(f < 35.5 && t < 71.0) cout << "AAA" << endl;
    else if(f < 37.5 && t < 77.0) cout << "AA" << endl;
    else if(f < 40.0 && t < 83.0) cout << "A" << endl;
    else if(f < 43.0 && t < 89.0) cout << "B" << endl;
    else if(f < 50.0 && t < 105.0) cout << "C" << endl;
    else if(f < 55.0 && t < 116.0) cout << "D" << endl;
    else if(f < 70.0 && t < 148.0) cout << "E" << endl;
    else cout << "NA" << endl;
  }
}

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

int main(){

  double a,b;

  while(scanf("%lf",&a) != EOF){
    
    scanf("%lf",&b);

    if(a < 35.5 && b < 71) printf("AAA\n");
    else if(a < 37.5 && b < 77) printf("AA\n");
    else if(a < 40 && b < 83) printf("A\n");
    else if(a < 43 && b <  89) printf("B\n");
    else if(a < 50 && b <  105) printf("C\n");
    else if(a < 55 && b <  116) printf("D\n");
    else if(a < 70 && b <  148) printf("E\n");
    else printf("NA\n");

  }

  return (0);
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <ctype.h>
#include <string>
#include <iostream>
#include <vector>
#include <stack>
#include <fstream>
#include <sstream>
#include <queue>
#include <exception>
#include <cmath>
#include <numeric>
#include <map>
#include <algorithm>
#include <bitset>
#include <set>
#include <functional>

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

using namespace std;
typedef long long int lint;

string grade[8] = { "NA", "E", "D", "C", "B", "A", "AA", "AAA" };
double t500[8] = { 70, 55, 50, 43, 40, 37.5, 35.5, 0 };
double t1000[8] = { 148, 116, 105, 89, 83, 77, 71, 0 };

bool AOJ0123()
{
	double t1, t2;
	if (!(cin >> t1 >> t2)) return false;
	
	REP(i, 8) {
		if (t1 >= t500[i] || t2 >= t1000[i]) {
			cout << grade[i] << endl;
			return true;
		}
	}

	return true;
}

int main()
{

	while (AOJ0123()) {

	}

	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

int main(){
	double a,b;
	

	double table1[] = {35.5,37.5,40.0,43.0,50.0,55.0,70.0};
	double table2[] = {71.0,77.0,83.0,89.0,105.0,116.0,148.0};
	string rank[] = {"AAA","AA","A","B","C","D","E","NA"};

	while(~scanf("%lf %lf",&a,&b)){
		int c=7,d=7;
		for(int i=0;i<sizeof(table1)/sizeof(double);i++){
			if(a < table1[i]) { c = i; break; }
		}

		for(int i=0;i<sizeof(table2)/sizeof(double);i++){
			if(b < table2[i]) { d = i; break; }
		}

		cout << rank[max(c,d)] << endl;

	}
}

C++: #include <iostream>
#include <stdio.h>
#include <utility>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
    double t5,t10;
	string ans;
	while(cin){
		cin>>t5>>t10;
		if(t5<35.50&&t10<71.00){
			ans="AAA";
		}else if(t5<37.50&&t10<67.00){
			ans="AA";
		}else if(t5<40.00&&t10<83.00){
			ans="A";
		}else if(t5<43.00&&t10<89.00){
			ans="B";
		}else if(t5<50.00&&t10<105.00){
			ans="C";
		}else if(t5<55.00&&t10<116.00){
			ans="D";
		}else if(t5<70.00&&t10<148.00){
			ans="E";
		}else{
			ans="NA";
		}
		cout<<ans<<endl;
	}
    return 0;
}

C++: #include <cstdio>

int main(){
	double a,b;
	while(scanf("%lf%lf", &a, &b) != EOF){
		if(a < 35.50 && b < 71.00) printf("AAA\n");
		else if(a < 37.50 && b < 77.00) printf("AA\n");
		else if(a < 40.00 && b < 83.00) printf("A\n");
		else if(a < 43.00 && b < 89.00) printf("B\n");
		else if(a < 50.00 && b < 105.00) printf("C\n");
		else if(a < 55.00 && b < 116.00) printf("D\n");
		else if(a < 70.00 && b < 148.00) printf("E\n");
		else printf("NA\n");
	}
}

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

int main() {
	double a, b;
	while(cin >> a >> b) {
		if(a < 35.50 && b < 71.00)
			cout << "AAA" << endl;
		else if(a < 37.50 && b < 77.00)
			cout << "AA" << endl;
		else if(a < 40.00 && b < 83.00)
			cout << "A" << endl;
		else if(a < 43.00 && b < 89.00)
			cout << "B" << endl;
		else if(a < 50.00 && b < 105.00)
			cout << "C" << endl;
		else if(a < 55.00 && b < 116.00)
			cout << "D" << endl;
		else if(a < 70.00 && b < 148.00)
			cout << "E" << endl;
		else
			cout << "NA" << endl;
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

int main(void){

  double m500,m1000;

  while( cin >> m500 >> m1000 ){

    if( m500 < 35.5 && m1000 < 71 ) cout << "AAA" << endl;
    else if( m500 < 37 && m1000 < 77 ) cout << "AA" << endl;
    else if( m500 < 40 && m1000 < 83 ) cout << "A" << endl;
    else if( m500 < 43 && m1000 < 89 ) cout << "B" << endl;
    else if( m500 < 50 && m1000 < 105 ) cout << "C" << endl;
    else if( m500 < 55 && m1000 < 116 ) cout << "D" << endl;
    else if( m500 < 70 && m1000 < 148 ) cout << "E" << endl;
    else cout << "NA" << endl;

  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	double a, b;
	while (cin >> a >> b){
		if (a < 35.5 && b < 61)cout << "AAA";
		else if (a < 37.5 && b < 67)cout << "AA";
		else if (a < 40 && b < 73)cout << "A";
		else if (a < 43 && b < 79)cout << "B";
		else if (a < 50 && b < 105)cout << "C";
		else if (a < 55 && b < 116)cout << "D";
		else if (a < 70 && b < 148)cout << "E";
		else cout << "NA";
		cout << endl;
	}
}

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

int main(){
	double tim1[] = {35.5,37.5,40.0,43.0,50.0,55.0,70.0},tim2[] = {71.0,77.0,83.0,89.0,105.0,116.0,148.0};
	string rnk[] = {"AAA","AA","A","B","C","D","E"};
	double t1,t2;
	while(cin >> t1 >> t2){
		int i = 0;
		for(;i < 7;i++){
			if(t1 < tim1[i] && t2 < tim2[i]) break;
		}
		if(i == 7) cout << "NA" << endl;
		else cout << rnk[i] << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	float q,p,c=0;
	while(c!=2){
		cin >> q >> p;
		if(35.50>=q&&71.00>=p)cout << "AAA";
		else if(37.50>=q&&77.00>=p)cout << "AA";
		else if(40.00>=q&&83.00>=p)cout << 'A';
		else if(43.00>=q&&89.00>=p)cout << 'B';
		else if(50.00>=q&&105.00>=p)cout << 'C';
		else if(55.00>=q&&116.00>=p)cout <<'D';
		else if(70.00>=q&&148.00>=p)cout <<'E';
		else {
			cout << "NA";
		}
		c++;
	}
	return 0;
}