C/C++の宿題を片付けます 103代目at TECH
C/C++の宿題を片付けます 103代目 - 暇つぶし2ch892:デフォルトの名無しさん
08/02/03 03:30:01
>>891
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(void){
  int *table=(int*)calloc(sizeof(int), 10000, 0), i, x;
  FILE *in=fopen("input8500.txt","r");
  for(i=0; i<8500; i++){
    fscanf(in, "%d", &x);
    table[x]++;
  }
  for(i=x=0; i<10000; x+=table[i]?1:0, i++);
  printf("%d種類\n", x);
}

コンパイラ無いので,試してないけど動くんじゃね?


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch