This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
auto factors( T )( T number ) | |
{ | |
import std.math; | |
bool[ T ] result; | |
for( size_t i = 1; i <= cast( uint ) sqrt( cast( double ) number ); ++i ) | |
{ | |
if ( number % i == 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program CountSubarrays; | |
var | |
TestCases : integer ; | |
ArrLen : longint ; | |
Arr, temp : array of longint ; | |
i, j, x : integer ; | |
TotalAscending : longint ; | |
OuterLoopFlag : boolean ; | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <TGUI/TGUI.hpp> | |
#include "include/apple.hpp" | |
#include "include/snake1.hpp" | |
#include "include/snake2.hpp" | |
int main() | |
{ | |
sf::RenderWindow app_win{sf::VideoMode{450, 450}, "snake vs snake"}; | |
sf::Vector2f win_size{(float) app_win.getSize().x, (float) app_win.getSize().y}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFGUI/SFGUI.hpp> | |
#include <SFGUI/Widgets.hpp> | |
#include <SFML/Graphics.hpp> | |
int main() | |
{ | |
enum class Option {none, rectangle, circle}; | |
Option option = Option::none; | |
sf::RenderWindow win{sf::VideoMode{400, 400}, "sfgui test"}; | |
sfg::SFGUI sfgui; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
enum class Condition {bigger, smaller, equal}; | |
int input1; | |
int input2; | |
Condition condition; | |
std::cout << "enter first number\n"; | |
std::cin >> input1; |