Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
using namespace std; struct Point{ int x, y; }point; char sign_sin(Point p){ if(p.y>0){ return '+'; }else{ return '-'; } } char sign_cos(Point p){ if(p.x>0){ return '+'; }else{ return '-'; } } char sign_tan(Point p){ if(p.x>0 && p.y>0 || p.x<0 && p.y<0){ return '+'; }else{ return '-'; } } int main(){ int x, y; while(cin >> x >> y){ if(x==0 || y==0){ cout << "Invalid point! either x or y located in their axis. Enter a new point : " << endl; continue; } point.x = x; point.y = y; cout << "sin " << sign_sin(point) << endl; cout << "cos " << sign_cos(point) << endl; cout << "tan " << sign_tan(point) << endl; } return 0; }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)