Search Results
6/19/2025, 7:35:19 AM
#include <stdio.h>
#include <ctype.h>
int
main(void)
{
const char *set1 = "AEILNORSTU";
const char *set2 = "DG";
const char *set3 = "BCMP";
const char *set4 = "FHVWY";
const char *set5 = "K";
const char *set8 = "JX";
const char *set10 = "QZ";
char user_word[64];
printf("Enter a word: ");
fgets(user_word, sizeof(user_word), stdin);
int scores[256] = {0};
for(const char *c = set1; *c; ++c)
scores[*c] = 1;
for(const char *c = set2; *c; ++c)
scores[*c] = 2;
for(const char *c = set3; *c; ++c)
scores[*c] = 3;
for(const char *c = set4; *c; ++c)
scores[*c] = 4;
for(const char *c = set5; *c; ++c)
scores[*c] = 5;
for(const char *c = set8; *c; ++c)
scores[*c] = 8;
for(const char *c = set10; *c; ++c)
scores[*c] = 10;
int score_total = 0;
for(const char *c = user_word; *c; ++c){
score_total += scores[toupper(*c)];
}
printf("Score total: %d\n", score_total);
return(0);
}
#include <ctype.h>
int
main(void)
{
const char *set1 = "AEILNORSTU";
const char *set2 = "DG";
const char *set3 = "BCMP";
const char *set4 = "FHVWY";
const char *set5 = "K";
const char *set8 = "JX";
const char *set10 = "QZ";
char user_word[64];
printf("Enter a word: ");
fgets(user_word, sizeof(user_word), stdin);
int scores[256] = {0};
for(const char *c = set1; *c; ++c)
scores[*c] = 1;
for(const char *c = set2; *c; ++c)
scores[*c] = 2;
for(const char *c = set3; *c; ++c)
scores[*c] = 3;
for(const char *c = set4; *c; ++c)
scores[*c] = 4;
for(const char *c = set5; *c; ++c)
scores[*c] = 5;
for(const char *c = set8; *c; ++c)
scores[*c] = 8;
for(const char *c = set10; *c; ++c)
scores[*c] = 10;
int score_total = 0;
for(const char *c = user_word; *c; ++c){
score_total += scores[toupper(*c)];
}
printf("Score total: %d\n", score_total);
return(0);
}
6/14/2025, 6:32:29 PM
6/12/2025, 3:35:54 PM
#include <stdio.h>
#include <string.h>
int
main(void)
{
char user_input[128];
printf("Enter string: ");
fgets(user_input, sizeof(user_input), stdin);
size_t len = strlen(user_input);
for (int i = 0; i <= len; ++i){
if (user_input[i] >= 'a' && user_input[i] <= 'z'){
user_input[i] -= 32;
}
}
printf("%s", user_input);
return (0);
}
#include <string.h>
int
main(void)
{
char user_input[128];
printf("Enter string: ");
fgets(user_input, sizeof(user_input), stdin);
size_t len = strlen(user_input);
for (int i = 0; i <= len; ++i){
if (user_input[i] >= 'a' && user_input[i] <= 'z'){
user_input[i] -= 32;
}
}
printf("%s", user_input);
return (0);
}
Page 1