TnT为什么编译错误,明明可以编译TnT
  • 板块题目总版
  • 楼主NEWDJI
  • 当前回复4
  • 已保存回复4
  • 发布时间2024/8/5 17:25
  • 上次更新2024/8/5 18:30:16
查看原帖
TnT为什么编译错误,明明可以编译TnT
1139386
NEWDJI楼主2024/8/5 17:25
#include<bits/stdc++.h>
using namespace std;
int main() {
	char a[256] = {};
	int ans = 0;
	gets(a);
	for (int i = 0; i < strlen(a); i++) {
		if (a[i] == ' ') {
			ans++;
		} else {
			if (a[i] >= 97 + 15) {
				if (a[i] - 3 <= 'p') {
					ans += a[i] - 'p' + 1;
				} else {
					if (a[i] - 2 <= 't') {
						ans += a[i] - 't' + 1;
					} else {
						ans += a[i] - 'w' + 1;
					}
				}
			} else {
				if ((a[i] - 96) % 3 == 0) {
					ans += 3;
				} else {
					ans += (a[i] - 96) % 3;
				}
			}

		}
	}
	cout << ans;
}

TnT为什么编译错误,明明可以编译TnT

2024/8/5 17:25
加载中...