Advertisement
Gireada

Tema nr.12 info

Jan 28th, 2013
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include<iostream.h>
  2. #include<conio.h>
  3.  
  4. int main()
  5. {int a,b,c,i,np,nn,ult,pn,k,ma;
  6. cin>>a,b;
  7. np=0;n=0;sum=0;ult=0;pn=1;k=0;ma=0;
  8. for(i=a;i<=b;i++)
  9. {
  10.     if(i>0)
  11.     {cout<<"pozitiv"<<i;
  12.      np+=1;
  13.     }
  14.     if(i<0)
  15.     {cout<<"negativ"<<i;
  16.      nn+=1;
  17.     }
  18. }
  19. cout<<np<<nn;
  20. for(i=a;i<=b;i++)
  21. {
  22.     if(i%2==0
  23.     {
  24.     sum+=i;
  25.     }
  26. }
  27.  
  28. while(sum)
  29. {ult = sum%10;
  30. sum = sum /10;
  31. }
  32. cout<<ult;
  33.  
  34. for(i=a;i<=b;i++)
  35. {
  36.     if(i>=10 && i<=99)
  37.     {
  38.         if(i>=-99 && i<=-10)
  39.         {pn=pn*i;
  40.         k+=1;
  41.         }
  42.     }
  43. }
  44.  
  45. ma=pow(pm,k);
  46. cout<<ma<<k;
  47. getch();
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement