Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int opcao, i;
- double x, soma;
- do
- {
- i=0;
- soma=0.0;
- while (i<2)
- {
- scanf("%ld", &x);
- if(x>=0.0 && x<=10.0)
- {
- soma+=x;
- ++i;
- }
- else
- {
- printf("nota invalida\n");
- }
- }
- printf("media = %.2lf\n", soma/2.0);
- do{
- printf("novo calculo (1-sim 2-nao)\n");
- scanf("%d", &opcao);
- }while(opcao<1 || opcao>22);
- }while(opcao!=2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement