Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
为什么输出有问题呀?#include<stdlib.h> #include<stdio.h> #include<iostream> using namespace std; void main() { char str1[13],count[100]; int str2[13]; int i,j,k=0,c; cout<<"Please input 2 to 15 unique positive integers(number<99):"<<endl; do{k++; cin.getline(str1,13,'0'); for(i=0;i<cin.gcount();i++) str2[i]=atoi("str1[i]"); for(i=0;i<cin.gcount()-1;i++) { for(j=i+1;j<cin.gcount();j++) { if(str2[i]==2*str2[j]||str2[i]==(float)str2[j]/2) count[k]++; } } } while(str2[0]!=-1); for(c=1;c<k;c++) cout<<count[c]<<endl; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator