forget post
I write up that two ways also WA
why??
who can solve for me?
THX
Search found 3 matches
- Tue Jan 04, 2005 8:54 am
- Forum: Volume 100 (10000-10099)
- Topic: 10062 - Tell me the frequencies!
- Replies: 235
- Views: 69482
- Tue Jan 04, 2005 8:51 am
- Forum: Volume 100 (10000-10099)
- Topic: 10062 - Tell me the frequencies!
- Replies: 235
- Views: 69482
and the second way is also WA...why??
#include <stdio.h>
void main(void)
{
int c,k=0,i,b,j;
int a[1000][2];
for(i=0; i<1000; i++){
a [0]=0;
a [1]=0;
}
while((c = getchar()) !=EOF){
for(i=0;i<k;i++){
if(c==a [0]){
++a [1];
break;
}
}
if(c!=a [0]){
a[k][0]=c;
k++;
}
if(c==10){
for(j=0;j<1000;j++){
for(i=0;i<k-2;i ...
void main(void)
{
int c,k=0,i,b,j;
int a[1000][2];
for(i=0; i<1000; i++){
a [0]=0;
a [1]=0;
}
while((c = getchar()) !=EOF){
for(i=0;i<k;i++){
if(c==a [0]){
++a [1];
break;
}
}
if(c!=a [0]){
a[k][0]=c;
k++;
}
if(c==10){
for(j=0;j<1000;j++){
for(i=0;i<k-2;i ...
- Sun Jan 02, 2005 12:35 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10062 - Tell me the frequencies!
- Replies: 235
- Views: 69482
10062 why Runtime Error (SIGSEGV)andWA
#include <stdio.h>
void main(void)
{
int c,k=0,i,b,j,l,m;
int a[90][1000][2];
for(j=0;j<90;++j){
for(i=0; i<1000; ++i){
a[j] [0]=0;
a[j] [1]=0;
}
}
l=0;
while((c = getchar()) !=EOF){
if(c=='\n'){
a[l][k][0]=10;
a[l][k][1]=1001;
l++;
k=-1;
}
for(i=0;i<k;i++){
if(c==a[l] [0]){
++a ...
void main(void)
{
int c,k=0,i,b,j,l,m;
int a[90][1000][2];
for(j=0;j<90;++j){
for(i=0; i<1000; ++i){
a[j] [0]=0;
a[j] [1]=0;
}
}
l=0;
while((c = getchar()) !=EOF){
if(c=='\n'){
a[l][k][0]=10;
a[l][k][1]=1001;
l++;
k=-1;
}
for(i=0;i<k;i++){
if(c==a[l] [0]){
++a ...