| 
 | 
 
 
发表于 2021-8-12 17:47:03
|
显示全部楼层
 
 
 
0 
100 
 
1 
11 
 
2 
c = 5; 
b = c; 
a = b; 
 
3 
a=10 
b=5 
c=5 
 
4 
x?x >= 0:x<0; 
 
5 
A 
#include<stdio.h> 
 
int main() 
{ 
        int size,flag; 
        float cost,bill; 
         
        scanf("%d",&size); 
        scanf("%f",&cost); 
        if (size > 12) 
        { 
            cost = cost * 1.05; 
            flag = 2; 
        }         
        bill = cost * flag; 
        printf("%d %.2f %d %.2f\n",size,cost,flag,bill); 
         
        return 0; 
} 
B 
#include<stdio.h> 
 
int main() 
{ 
        int ibex,sheds,help; 
         
        scanf("%d",&ibex); 
        if (ibex > 14) 
        { 
            sheds = 3; 
        } 
        else 
        { 
                sheds = 2; 
        } 
        help = 2 * sheds; 
        printf("%d %d %d \n",ibex,sheds,help); 
         
        return 0; 
} 
C 
#include<stdio.h> 
 
int main() 
{ 
        int score,count; 
         
        scanf("%d",&score); 
        while(1) 
        { 
                if (score < 0) 
                { 
                    printf("count = %d\n", count); 
                    break; 
                }         
                else 
                { 
                        count++; 
                        scanf("%d", &score); 
                } 
        } 
         
        return 0; 
} 
 
 
0 
... |   
 
 
 
 |