Você está na página 1de 7

c  


 
 
      
  
    
 
 
     
    

 


  

 
 
  

 
      
 


— 
a 
1
2
88
42
99

ë
1
2
88

1.#include<iostream>

2.
3.using namespace std;
4.int main()

5.{while (1) {
7. int num;
8. cin >> num;
9. if (num == 42) break;
10. cout << num << endl;
11. }
12. return 0;
13.}

r   

         


 
   
 

!"r #  


        
  


 
 $   %
&     

   '!'
(
r #  
  




 
 

a 

r 
) 
 '* *+'''
 
    r  


,  
)  '*+ *+'''

 
    r # 
 
  

ë

ë


 
  





 
 ")   

 
    -
  

     
 

 


 
 " 


 
   

—  
     
a 
30 120.00

ë
89.50
—  a     
a 
42 120.00

ë
120.00
—  a      
a 
300 120.00

ë
120.00

1. #include <iostream>


2.
3. using namespace std;
4.
5. void try_withdrawal(int & amount, float & balance)
6. {
7. if(((amount + 0.5) <= balance)
8. && ((amount % 5) == 0))
9. {
10. balance = balance - amount - 0.5;
11. }
12. }
13. int main()
14. {
15. int amount;
16. float balance;
17. cin >> amount >> balance;
18. try_withdrawal(amount, balance);
19. cout.precision(2);
20. cout << fixed << balance << endl;
21. return 0;
22. }

2  
 

1. #include <iostream>


2. using namespace std;
3.
4. int main() {
5. float amount;
6. float balance;
7. float result;
8. cin >> amount >> balance;
9. cout.precision(2);
10. if(int(amount*100)%500==0) {
11. if((balance-amount-0.50)>=0) {
12. cout << fixed << balance-amount-0.50;
13. }
14. else cout << fixed << balance;
15. }
16. else cout << fixed << balance;
17. cout << endl;
18. return 0;
19. }
20.


 


 .
    
 
 $% 
  )   

   $
 
) 
 

   % )     


/ 



 
 $

   ) %ë  "/     


 
   
 


   

   ) 

    
.) 
 /  
) 
"
  






) 
 
)  

 

 
  r    )   

)  


    

  
     

 
 
   

 
 "   
    
       
  

"  



     0 )  r  0
 )  
 ) -  ) ,/  
 ) 
" 
) 

  ") ,1  
 
 2  
  2 

   

  
  
34,   )    )   
)  ,
    

    
 ) 
  /
  
 )    ) 

  
 
 )  
"
  
 
 


   
 
  
 





 )  


 
&  2 "
  

 5&  
) 
 ,"5$,% 
  6  

  

    ,1 
 


 
  )    -  ) 
   ,3*,"

5$,3%*+5$,%-
     ) 0 0
6   
  
)  7  

  6   
 5 ) 

"    
 


 

)   



a 

     
) 
   

  
$ 8
 
3'''''%-

  
  
  
   
    "   
 2
   
) 
  ,"3*+,*+
3'''''''''


ë

&  )  ," 



    

    
) 
 5$,%

— 

 -
9
6
3
60
100
1024
23456
8735373
 ë

9
0
14
24
253
5861
2183837

1. #include<iostream>
2. #include<cmath>
3. using namespace std;
4. main()
5. {
6. int t;
7. cin>>t;
8. while(t--)
9. {
10. int n,i=1,sum=0;
11. cin>>n;
12. while(pow(5,i)<=n)
13. {
14. sum+=n/(pow(5,i));
15. i++;
16. }
17. cout<<sum<<endl;
18. }
19. }


  
    
) 


   
 

   



      

  a ëc   2 

   
  
 

!/ 

   

 

a 

:

  

  
) 
  $"*+3' %  2
  
 
   
) 
 
"

;
 

3' "  

ë

7
  
 
 

" 
 
  
 )    

— 
a 
7 3
1
51
966369
7
9
999996
11

ë
4

1. #include <iostream>


2.
3. int main() {
4. int num;
5. long inp, div, count = 0;
6.
7. using std::cin;
8. using std::cout;
9. using std::endl;
10.
11. cin>>num>>div;
12. while (num--) {
13. cin>>inp;
14. if (0 == inp % div) count++;
15. }
16. cout<<count<<endl;
17. return 0;
18. }

     

 
c  ) 
 ) 
 $2"%<3'=>?2"?3'=>"2@A  6 $3??!''''%B
 


) 

 )
c  

 
   
  8
     
 9
3C)3DC)D4C)4DC)3DC)+$"%    

#    
) 
  <'??3'=3EA
BB# (,,ë /F5FGëH%
-
  "  
     
  
) 
 
 
)   
  

  

) 
$" %
+ 

a 

&
  

 
 
 
$3?
?3''%   

  

 
  
&   

 "

  
 $  ) 
 

%   "   
 
  

      

) 
$" %

ë

ë

  
 2

 "
0cF0 0,ë0$


8
 
  

    

 %

a 
2
3
0 1
-1 0
1 0

4
1 2
10 -6
-5 -1
1 -1

ë


—   


 393+'"+3"4+3

 93+"+'"4+3"+4

1. #include<iostream>
2. #include<stdio.h>
3.
4. using namespace std;
5.
6. int main(void)
7. {
8. int t,n;
9. int neg,pos,diff,x,y;
10. scanf("%d",&t);
11. while(t--)
12. {
13. scanf("%d",&n);
14. pos=neg=0;
15. while(n--)
16. {
17. scanf("%d%d",&x,&y);
18. diff=x-y;
19. if(diff>0)pos++;
20. else neg++;
21. }
22. if(pos==0||neg==0)
23. printf("NO\n");
24. else
25. printf(" \n");
26. }
27. }