#37938: c 基礎寫法


q0908309831@gmail.com (浪人飄飄)


#include <stdio.h>
 
int main() {
 
char list[1001];
 
while (scanf("%s", list) != EOF) {
int times[26] = { 0 }; //代表26個英文出現的次數
int count = 0; //判斷奇數次出現次數
 
for (int i = 0; list[i] != '\0'; i++) {
int a = (int)list[i];
 
if (0 <= (a - 65) && (a - 65) <= 25) { //字母大寫時,判斷條件
times[a-65]++;
}
if (0 <= (a - 97) && (a - 97) <= 25) { //字母小寫時,判斷條件
times[a - 97]++;
}
}
for (int i = 0; i <= 25; i++) {
if (times[i] % 2 == 1) count++;
}
 
count <= 1 ? printf("yes !\n") : printf("no...\n");
 
}
 
return 0;
}
 
有問題,麻煩跟我說,謝謝您
#37939: Re: c 基礎寫法


q0908309831@gmail.com (浪人飄飄)


抱歉,沒有縮排,將就一下



#37949: Re: c 基礎寫法


wsx9633 (wsx9633)


抱歉,沒有縮排,將就一下




At a men's gas station in Taiwan, a school stewardess, nurse, and model. Internet celebrity Ke Xi TG is nini9595 Lai 5280366.