K
Khách

Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.

9 tháng 1 2021

#include <iostream>

#include <fstream>

using namespace std;

ifstream input("D:/input.txt");

ofstream output("D:/ouput.txt");

int main()

{   

    int A[1000];

    int n ,dem=0;

    input >> n;

    for(int i=0;i<n;i++)       

        input >> A[i];   

    for(int i=0;i<n;i++)       

           if(A[i]<0)           

              dem +=A[i]; 

    output << dem; 

     return 0;

}

uses crt;

var a:array[1..100]of integer;

i,n,t:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

begin

write('A[',i,']='); readln(a[i]);

end;

t:=0;

for i:=1 to n do 

  if a[i]<0 then t:=t+a[i];

writeln('Tong cac so nguyen am la: ',t);

readln;

end.

28 tháng 10 2021

Ảnh mờ quá ạ. Mình không thấy được🥺

30 tháng 10 2021

#include <bits/stdc++.h>

using namespace std;

long long x,i,n,nn;

int main()

{

cin>>n;

int dem=0;

for (i=1; i<=n; i++)

{

cin>>x;

if (x==0) dem++;

}

cout<<dem;

return 0;

}

18 tháng 12 2021

#include <bits/stdc++.h>

using namespace std;

long long x,n,i,t;

int main()

{

cin>>n;

t=0;

for (i=1; i<=n; i++)

{

cin>>x;

t=t+x;

}

cout<<t;

return 0;

}

#include <bits/stdc++.h>

using namespace std;

long long i,n,x,t;

int main()

{

cin>>n;

t=0;

for (i=1; i<=n; i++)

{

cin>>x;

if (x>0) t=t+x;

}

cout<<t;

return 0;

}

29 tháng 12 2020

phần a

29 tháng 12 2020

phần b

21 tháng 10 2021

#include <bits/stdc++.h>

using namespace std;

long long n,i,x,t,dem;

int main()

{

cin>>n;

t=0;

dem=0;

for (i=1; i<=n; i++)

{

cin>>x;

if (x<5) 

{

t=t+x;

dem++;

}

}

cout<<t<<" "<<dem;

return 0;

}

29 tháng 10 2021

undefined

10 tháng 12 2021

huhu giúp với ạ cần gấp lắm

10 tháng 12 2021

1:

#include <bits/stdc++.h>

using namespace std;

long long n,i,x,t;

int main()

{

cin>>n;

t=0;

for (i=1; i<=n; i++)

{

cin>>x;

t=t+x;

}

cout<<t;

return 0;

}

11 tháng 11 2021

a: 

#include <bits/stdc++.h>

using namespace std;

long long n,i,x;

int main()

{

cin>>n;

int t=0;

for (i=1; i<=n; i++)

{

cin>>x;

t=t+x;

}

cout<<t;

return 0;

}