アプリ版:「スタンプのみでお礼する」機能のリリースについて

急募です!!
キーボードから入力したテキストファイルに含まれるアルファベットの小文字のみを数えて表示するプログラムを、教えてください
使用言語は、C言語です

A 回答 (4件)

#include <stdio.h>


#include <ctype.h>

int main() {
  int c, n = 0;
  while( (c = getchar()) != EOF )
    if( islower(c) ) n++;
  printf("%d\n", n);
}
    • good
    • 0

「キーボードから入力したテキストファイル」ってなに?



そして, 何がわからない? 自分でどこまでやった?
    • good
    • 0

本当はこっち


#include <stdio.h>

int main() {
char str[100];
int res=0;
scanf("%s", str);

for (int i=0; str[i]!='\0'; i++) {
if (str[i]>='a' && str[i]<='z') res++;
}

printf("%d\n", res);
return 0;
}
    • good
    • 0

どうぞ



#include <stdio.h>

int main() {
char c;
scanf("%c", &c);

printf("%c\n", c);
return 0;
}
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!