#17211: c++ NA(50%)


wish.rirf@gmail.com (C++ 與我)

School : 臺北市私立薇閣高級中學
ID : 82132
IP address : [210.243.39.11]
Last Login :
2019-06-13 14:50:22
c680. 電腦閱卷 1 -- it's david | From: [60.248.154.140] | Post Date : 2019-03-28 14:21

#include<iostream>
using namespace std;
int student,score = 0,point,anslen;
int main(){
 cin>>anslen;
 point = 100/anslen;
 string standard,studentans;
 cin>>standard;
 cin>>student;
 for(int i = 0;i<student;i++){
  score = 0;
  cin>>studentans;
  for(int j = 0;j<anslen||j<=studentans.length();j++){
   if(studentans[j] == standard[j])
   score += point;
  }
  cout<<score<<'\n';
 }
}

My code:

不確定哪裡不對

 
#17545: Re:c++ NA(50%)


ufve0704 (爬 我爬 我爬爬爬 有排行榜這種東西就是要爬 爬過我上面的那...)

School : 臺北市私立延平高級中學
ID : 83268
IP address : [203.72.178.252]
Last Login :
2019-07-23 12:26:05
c680. 電腦閱卷 1 -- it's david | From: [114.42.218.170] | Post Date : 2019-04-20 17:06

#include
using namespace std;
int student,score = 0,point,anslen;
int main(){
 cin>>anslen;
 point = 100/anslen;
 string standard,studentans;
 cin>>standard;
 cin>>student;
 for(int i = 0;i<student;i++){
  score = 0;
  cin>>studentans;
  for(int j = 0;j<anslen||j<=studentans.length();j++){
   if(studentans[j] == standard[j])
   score += point;
  }
  cout<<score<<'\n';
 }
}

My code:

不確定哪裡不對


我也是50%....


#include<bits/stdc++.h>

using namespace std;

int main(){

int a,e,d,g;

cin>>a;

e=100/a;

char b[a],c[a];

cin>>b;

cin>>d;

while(d--){

g=0;

cin>>c;

for(int f=0;f<a;f++){

if(b[f]==c[f])

g=g+e;

}

cout<<g<<endl;

}

}

 

 
ZeroJudge Forum