コード例 #1
0
ファイル: INTERVAL.CPP プロジェクト: stden/dm-judge
void main(){
  long tests,test;
  in >> tests;
  for(test=0;test<tests;test++){
    long x,y,b,sum=0;
    in >> x >> y >> b;
    if(x>y) {sum=x;x=y;y=sum;sum=0;};
    if(b==1) sum+=(y-x)+1;
    else for(long i=x;i<=y;i++) sum+=perevod(i,b);
    out << sum << endl;
  };
  in.close(); out.close();
};
コード例 #2
0
int main()
{
    int x,b;
    printf("vvedite nujnuu vasm sistemu ischeslenia?\n");
    scanf("%d",&b);
    if (b<2||b>36)
    {
        printf("nizya,vvedite drugoe!");
    }

    else
        printf("vvedite vashe chislo\n");
    scanf("%d",&x);
    printf("vashe chislo pri perevode v %d sistemu ischislenie stalo ravnim \n x=",b);
    perevod (x,b);
    return 0;
}