Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7230 - Синус нийлбэр 1

sin(x)+sin(x2)+sin(x3)+...+sin(xn) нийлбэрийг ол.

Input

Бодит тоо x, натурал тоо n зайгаар тусгаарлагдан нэг мөрөнд өгөгдөнө.

Output

Нийлбэр. Таслалаас хойш 3 орны нарийвчлалтай гарга.

Example

Input:
2.5 3

Output:
0.648

Нэмсэн:Bataa
Огноо:2013-01-23
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2022-06-17 16:18:51
#include<bits/stdc++.h>

using namespace std;

int main()
{
double a,r=0;
int b;
cin>>a>>b;
for(int i=1; i<=b; i++) {
r+=sin(pow(a, i));
}
cout<<fixed<<setprecision(3)<<r;
return 0;
}
2022-06-02 02:55:00
uher mongol
2022-05-20 06:24:36
shut the fuck up or I will kick your ass right now and right here, son of a bitch.
2022-01-23 09:59:12
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
float a,b,c,d=0,k;
int main()
{
scanf("%f %f",&a,&k);
for(c=1; c<=k; c++)
{
b=sin(pow(a,c));
d=d+b;
}
printf("%.3f",d);
}
dahiad tugsuu ah ni bn aa kkk
2021-11-28 17:21:12
you are looking at this comment because you're stuck or you're just being lazy. If you copy now, you will copy again and again and again. any thoughts? so stop copying and do it, or ask for some help.
2021-01-18 15:20:39
I have tried to solve this problem by using simple recursion but kept receiving the wrong answer.
Check out
#include <iostream>
#include <cmath>

using namespace std;

double sinus(double a, int n){
if(n == 1) return sin(a);
if(n == 0) return 0;
return sin(pow(a, n)) + sinus(a, (n - 1));
}

int main(){
double a;
int n;
cin >> a >> n;

cout.setf(ios::fixed);
cout.precision(3);

double res = sinus(a, n);
cout << res;

return 0;
}

Dear Corpse XD
2020-10-14 12:08:44
Hmmmmmmmmmm
2020-01-21 07:54:05
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int a,n;
double x,sum=0,I=1;
cin>>x>>n;
for(int i=1;i<=n;i++){
I*=x;
sum+=sin(I);
}
cout.setf(ios::fixed);
cout.precision(3);
cout<<sum<<endl;
return 0;
}
2019-11-02 06:33:04
#include <cstdio>
#include <cmath>

int main () {
int a , n , i;
double x;
scanf("%lf%d",&x , &n);
double sum = 0;
double l = 1;
for(i = 1 ; i <= n ; i++){
l = l * x;
sum = sum + sin(l);
}
printf("%.3lf" , sum );
}
SUPER
2019-11-02 06:23:11
#include<cstdio>
#include<cmath>
int main(){
int a,n,i;
double x;
scanf("%lf%d", &x , &n);
double sum=0;
double l=1;
for( i=1 ; i<=n ; i++){
l= l*x;
sum= sum +sin(l);
}
printf("%.3lf" , sum);

}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.