#include <stdio.h>
#define MVAIN 0.8592f
#define MVAOUT 1.0282f
#define ICMS 0.29f
int main( ) {
printf ( "Indique o valor dos produtos da nfe que contenham ST\n " ) ; float ProdValue = 0 ;
printf ( "O valor dos produtos é: %0.2f\n " , ProdValue
) ; printf ( "Informe se o MVA é fora ou dentro do estado\n " ) ; int MVA = 0 ;
float ValorMVA = ProdValue * ( MVA == 2 ? MVAOUT : MVAIN) ;
printf ( "O valor do MVA é %0.2f\n " , ValorMVA
) ; float ValorComMVA = ProdValue + ValorMVA;
printf ( "O valor total é %0.2f\n " , ValorComMVA
) ; float ValorIcms = ValorComMVA * ICMS;
printf ( "O valor do ICMS é %0.2f\n " , ValorIcms
) ; float Diferenca = ValorMVA - ValorIcms;
printf ( "O valor a recolher é %0.2f\n " , Diferenca
) ; }
//http://pt.stackoverflow.com/q/191144/101
I2luY2x1ZGUgPHN0ZGlvLmg+CgojZGVmaW5lIE1WQUlOICAwLjg1OTJmCiNkZWZpbmUgTVZBT1VUIDEuMDI4MmYKI2RlZmluZSBJQ01TIDAuMjlmCgppbnQgbWFpbigpewogICAgcHJpbnRmKCJJbmRpcXVlIG8gdmFsb3IgZG9zIHByb2R1dG9zIGRhIG5mZSBxdWUgY29udGVuaGFtIFNUXG4iKTsKCWZsb2F0IFByb2RWYWx1ZSA9IDA7CiAgICBzY2FuZigiJWYiLCAmUHJvZFZhbHVlKTsgICAKICAgIHByaW50ZigiTyB2YWxvciBkb3MgcHJvZHV0b3Mgw6k6ICUwLjJmXG4iLCBQcm9kVmFsdWUpOwogICAgcHJpbnRmKCJJbmZvcm1lIHNlIG8gTVZBIMOpIGZvcmEgb3UgZGVudHJvIGRvIGVzdGFkb1xuIik7CglpbnQgTVZBID0gMDsKICAgIHNjYW5mKCIlZCIsICZNVkEpOwogICAgZmxvYXQgVmFsb3JNVkEgPSBQcm9kVmFsdWUgKiAoTVZBID09IDIgPyBNVkFPVVQgOiBNVkFJTik7CiAgICBwcmludGYgKCJPIHZhbG9yIGR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