Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int i,x,y,tc;
- double div;
- scanf("%d",&tc);
- for(i=0;i<tc;i++){
- scanf("%d%d",&x,&y);
- if((x<0&&y==0)||(x==0&y==0)){
- printf("divisao impossivel\n");
- }
- else if(x==0&&y<0){
- div=(double)((x/y)*(-1));
- printf("%0.1lf\n",div);
- }
- else{
- div=(double)x/y;
- printf("%0.1lf\n",div);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement