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.
Python:
n=int(input("Nhap so nguyen duong n:"))
dem=0
for i in range(1,n+1):
if i%4==0:
dem=dem+1
print(dem)
Mỗi lần đc một bạn khác tick đúng sẽ đc 1 SP
Còn nếu đc GVQL tick thì sẽ đc 1 GP
#include <bits/stdc++.h>
using namespace std;
double a[100];
int i,n;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++) cout<<a[i]<<" ";
cout<<endl;
for (i=1; i<=n; i++)
swap(a[i],a[n+1-i]);
for (i=1; i<=n; i++) cout<<a[i]<<" ";
return 0;
}
bn ơi bn làm bằng pascal đc ko ạ, mik cần cả hai cái lun
uses crt;
var a:array[1..100]of integer;
n,dem,i,j:integer;
begin
clrscr;
readln(n);
for i:=1 to n do
read(a[i]);
for i:=1 to n do
begin
dem:=0;
for j:=1 to a[i] do
if a[i] mod j=0 then inc(dem);
if dem mod 2=0 then write('0 ')
else write('1 ');
end;
readln;
end.
1:
uses crt;
var st:string[50];
begin
clrscr;
write('Nhap xau:'); readln(st);
writeln('So luong ki tu la: ',length(st));
readln;
end.
#include <iostream>
using namespace std;
int main()
{
int a, b, c, tongtien, n, sovo;
cin >> a;
b = 2*a;
c = b - 10000;
tongtien = a+b+c;
n = (tongtien)%9500;
sovo = (tongtien - n)/9500;
cout << sovo << endl;
return 0;
}
Chúc bn học tốt!
Uses crt;
Var i,n,k,tong:integer;
tb:real;
a:array[1..1000] of integer;
f1,f2:text;
Begin
clrscr;
Assign(f1,'SONGUYEN.inp');
Assign(f2,'SONGUYEN.out');
Reset(f1);Readln(f1,n);
For i:= 1 to n do read(f1,a[i]);
close(f1);
k:=0;tong:=0;
For i:= 1 to n do If (a[i]<0) and (Abs(a[i]) mod 2 = 1) then
Begin
inc(k);
tong:=tong+a[i];
End;
tb:=tong/n;
Rewrite(f2);
writeln(f2,tb:0:2);
Writeln(f2,k);
close(f2);
readln;
End.
Câu 2:
const fi='xauhoa.inp';
fo='xauhoa.out';
var f1,f2:text;
st,s1:string;
d,i:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,st);
d:=length(st);
s1:='';
for i:=1 to d do
if st[i] in ['A'..'Z'] then s1:=s1+st[i];
writeln(f2,s1);
writeln(f2,length(s1));
close(f1);
close(f2);
end.