大厂笔试题
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
552 B

  1. /*第一行输入一个正整数n,代表菜品总数。第二行输入n个正整数ai,代表每道菜的价格。
  2. x和y,x代表满减的价格y代表红包的价格
  3. 4
  4. 10 20 10 20
  5. 25 10
  6. 25
  7. */
  8. #include <iostream>
  9. using namespace std;
  10. int main()
  11. {
  12. int n,a = 0,sum = 0;
  13. int manjian,hongbao;
  14. cin>>n;
  15. for(int i = 0;i < n; i++){
  16. cin>>a;
  17. sum = sum + a;
  18. }
  19. cin>>manjian;
  20. cin>>hongbao;
  21. cout << sum - manjian - hongbao << endl;
  22. return 0;
  23. }